Can I use the split method to separate every character in a string?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Steven Sargent
    New Member
    • Jan 2011
    • 6

    Can I use the split method to separate every character in a string?

    I want to know if there is a way to use the split function to separate every single character. For example, if I input "Hello", the program will output
    H
    e
    l
    l
    o

    Every tutorial I've found describes how to split the string on one or more specific characters.
  • Christian Binder
    Recognized Expert New Member
    • Jan 2008
    • 218

    #2
    I don't know, if it's possible using string.Split()-method, but maybe you could do it with string.ToCharAr ray().

    Comment

    • John Wilson CN
      New Member
      • Jan 2011
      • 1

      #3
      use the foreach loop for each char charcter and print the result as per ur requirement.I have use it in my Asp.net page.
      String Input = "Hello";
      foreach (Char ch in Input)
      {
      Response.Write( ch);
      }

      Comment

      • Steven Sargent
        New Member
        • Jan 2011
        • 6

        #4
        That worked great for outputting the characters or putting them in an array. But what if I only want to work with a single character?

        Comment

        Working...