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 :: windows form textbox numbers only 
Csharp :: unity projectile spread 
Csharp :: how to append a new line in a txt file c# 
Csharp :: taking input in single line c# 
Csharp :: c# application hangs while running 
Csharp :: unity convert mouse position to world position in editor mode 
Csharp :: c# generate random int in range 
Csharp :: unity c# set list to set active true 
Csharp :: website link in unity 
Csharp :: unity conditional field 
Csharp :: read configuration workerservice 
Csharp :: why vue cli do not refresh auto in local host 
Csharp :: C# socket bind to dns name 
Csharp :: xamarin picker item 
Csharp :: how to cast list to observablecollection c# 
Csharp :: unity object walkable not working 
Csharp :: c# convert utc to est 
Csharp :: how to get the color of other label when clicking c# 
Csharp :: how to unfreeze a rotation in a collider unity 2d 
Csharp :: c# image to byte array 
Csharp :: gvrviewer.instance.triggered replacement unity 
Csharp :: valid url in .net 
Csharp :: get enum int by name 
Csharp :: change array size in unity 
Csharp :: c# 2-dimensional array sort 
Csharp :: c# create instance from type 
Csharp :: unique id c# 
Csharp :: prettier c# 
Csharp :: difference between executescalar and executenonquery and executereader 
Csharp :: unity controls 3d 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =