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 :: abril modal boostrap 
Csharp :: c# split string into characters 
Csharp :: c# split text by spaces 
Csharp :: unity dictionary check if key exists 
Csharp :: unity instantiate with name 
Csharp :: c# how do you check if a string contains only digits 
Csharp :: cs entity framework 
Csharp :: merge point of two list 
Csharp :: content type application/json c# 
Csharp :: c# console background color 
Csharp :: how to make an object invisible unity 
Csharp :: unity new Color() 
Csharp :: convert text to number c# 
Csharp :: c# compile just one exe 
Csharp :: print random number unity 
Csharp :: write text files with C# 
Csharp :: unity3d remove parent 
Csharp :: convert generic to type c# 
Csharp :: c# to binary 
Csharp :: how to make font c# 
Csharp :: void ontriggerenter not working 
Csharp :: c# check if 2d array position exists 
Csharp :: c# join string array 
Csharp :: how to create a singleton in unity 
Csharp :: how to add a variable in unity c# 
Csharp :: make string uppercase c# 
Csharp :: c# find largest number in list 
Csharp :: bitmap to imagesource c# 
Csharp :: get folder path winforms 
Csharp :: when was the third world war 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =