ms_learn_csharp/022_array_operations/array_split_join/Program.cs

19 lines
454 B
C#
Raw Normal View History

2024-07-31 22:38:31 -04:00
Console.WriteLine("\n--- Reverse ---\n");
string value = "abc123";
char[] valueArray = value.ToCharArray();
Array.Reverse(valueArray);
string result = new string(valueArray);
Console.WriteLine(result);
Console.WriteLine("\n--- Join ---\n");
result = String.Join(",", valueArray);
Console.WriteLine(result);
Console.WriteLine("\n--- Split ---\n");
string[] items = result.Split(',');
foreach (string item in items) {
Console.WriteLine(item);
}