Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# repeat string x times

string result = new String('-', 5);
Output: -----
Comment

C# repeat x times

// Normally in a namespace, of course.
public class LoopUtilities
{
    public static void Repeat(int count, Action action)
    {
        for (int i = 0; i < count; i++)
        {
            action();
        }
    }
}

using static LoopUtilities;

// Class declaration etc, then:
Repeat(5, () => Console.WriteLine("Hello."));
Comment

repeat 10 timesw c#

        for (int i = 0; i < 10; i++)
        {

        }
Comment

PREVIOUS NEXT
Code Example
Csharp :: inline list in c# 
Csharp :: c sharp array to list 
Csharp :: unity hide in inspector 
Csharp :: c# decimal to hex 
Csharp :: changing euler angles unity 
Csharp :: unity making a coroutine wait until another coroutine is done 
Csharp :: ession in class c# 
Csharp :: remove first character in a string c# 
Csharp :: validate data exist in database lara vel 
Csharp :: c# split string into characters 
Csharp :: how to pause physics in unity c# 
Csharp :: ubuntu: how to open the terminal from c# 
Csharp :: unity deactivate all colliders of a gameobject 
Csharp :: compare two binary tree 
Csharp :: how to make an object invisible unity 
Csharp :: tinyint in c# 
Csharp :: asp.net model display name 
Csharp :: how to pass class type to method c# 
Csharp :: function in Razor Pages 
Csharp :: c# list of strings 
Csharp :: if statement swiftui 
Csharp :: base64 decode how used in c# 
Csharp :: enum element count C# 
Csharp :: decalre an int list mvc 
Csharp :: keybyvalue c# 
Csharp :: c# textbox numbers only 
Csharp :: how to add a queue unity 
Csharp :: make string uppercase c# 
Csharp :: c# string tob64 
Csharp :: Play Sound c# 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =