Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# for loop backwards

int[] myarray = new int[]{1,2,3,4};
for(int i = myarray.Length - 1; i >= 0; i--)
{
	Console.WriteLine(i);
}
Comment

c# loop backwards


for (int i = myArray.Length; i --> 0; )
{
    //do something
}

Comment

c# reverse a string for loop


---------------------------------------------------Option 1
foreach (int v in values.Select(x => x).Reverse())
{
      Console.Write(v + " ");
}
---------------------------------------------------Option 2
       public static void Main(string[] args)
        {
            Console.Write( Reverse("ABcdefgH") );
        }

		public static string Reverse(string s)
        {
            string result = String.Empty;
            char[] cArr = s.ToCharArray();
            int end = cArr.Length - 1;

            for (int i = end; i >= 0; i--)
            {
                result += cArr[i];
            }
            return result;
        }
Comment

c# loop backwards

string[] arr = new string[5];
for (int a = arr.Length; --a >= 0;)
{
  // ...
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# array backwards 
Csharp :: rate game in unity 
Csharp :: loop c# 
Csharp :: protected override void OnExiting(Object sender, EventArgs args) { base.OnExiting(sender, args); Environment.Exit(Environment.ExitCode); } 
Csharp :: c# loop example 
Csharp :: euler angles to quaternion unity 
Csharp :: unity trigger not detecting collision 
Csharp :: c# for loop last iteration 
Csharp :: unity iap 
Csharp :: how to make a enemy in unity 
Csharp :: How to make a drawer in unity 
Csharp :: rb.addforce 3d c# 
Csharp :: come controllare se textbox è vuota c# 
Csharp :: c# pass mouse events to parent 
Html :: html euro symbol 
Html :: ion-item remove bottom line 
Html :: ion-content background color 
Html :: html link to call phone number 
Html :: how to embed my website into Discord 
Html :: refresh button html 
Html :: html facebook meta tags 
Html :: accepts audio file in html 
Html :: input type="file" and display image 
Html :: regex to remove html tags python 
Html :: icons burger css font awesome 
Html :: start html 
Html :: html javascript input numbers only 
Html :: href phone 
Html :: hyperlink html 
Html :: ngfor with index 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =