How to separate a string into char array

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I have a string vaiable like "1a3345";

How to separate the string into a char array or a string array just have on
character per element?
 
ad said:
I have a string vaiable like "1a3345";

How to separate the string into a char array or a string array just have on
character per element?


string s = "1a3345";
char[] c = s.ToCharArray();

Hope it helps,
Andrey
 
ad said:
I have a string vaiable like "1a3345";

How to separate the string into a char array or a string array just have
on
character per element?

string by itself can be accessed as an array of chars
*********************************
string s = "1a3345";
char c = s[1];
Console.WriteLine(c);
*********************************
will give you "a" as an output

RGDS PSG
 
Back
Top