+how to C# split string (each char) into array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kate77
    New Member
    • Oct 2007
    • 14

    +how to C# split string (each char) into array

    Hello,
    Can anyone help me?

    I am trying to split a string in c# but i don't have a separator.

    for example split the string "hello"
    into array [0]=h [1]=e [2]=l [3]=l [4]=o
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Try this:
    Code:
    string mys="hello";
    char[] thechars=mys.ToCharArray();

    Comment

    • Kate77
      New Member
      • Oct 2007
      • 14

      #3
      Originally posted by Plater
      Try this:
      Code:
      string mys="hello";
      char[] thechars=mys.ToCharArray();
      Thanks!!!! it works.
      cheers.

      Comment

      Working...