Answers for "convert char array to int array c#"

C#
2

c# convert string to char array

using System;
public class myExample {
   public static void Main(){
     string strExample = "example";
      char[] charArr = strExample.ToCharArray();

      foreach (char c in charArr) {
        Console.WriteLine(c);
      }
   }
}
Posted by: Guest on February-17-2022
2

create char array c#

char[] arr = new char[5];

arr[0] = 'a';
arr[1] = 'b';
arr[2] = 'c';
arr[3] = 'd';
arr[4] = 'e';

//OR
char[] arr = new char[] {'a', 'b', 'c', 'd', 'e'};
Posted by: Guest on May-21-2020

C# Answers by Framework

Browse Popular Code Answers by Language