Skip to content

Instantly share code, notes, and snippets.

@Phuseos
Last active June 6, 2016 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Phuseos/dd9f3a15b04b0a154dddefa4c09b1473 to your computer and use it in GitHub Desktop.
Save Phuseos/dd9f3a15b04b0a154dddefa4c09b1473 to your computer and use it in GitHub Desktop.
Loop through an array and print the values (C#)
//Simple little loop that prints the dynamic values of the following decimals
public static decimal DeciValueOne { get; set; }
public static decimal DeciValueTwo { get; set; }
void GetArrayValue() {
decimal[] ItemsToNone = new decimal[] { DeciValueOne, DeciValueTwo }; //Declare array
for (int i = 0; i < ItemsToNone.Length; i++) //Loop over the arrays
{
Debug.WriteLine(ItemsToNone.GetValue(i)); //Print out the values
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment