How to transfer a string to char array

Discussion in 'Microsoft C# .NET' started by ad, Jun 19, 2005.

  1. ad

    ad Guest

    I have a string variable say:

    string sMyString="aeiou"

    How can I transfer sMyString into a char array?
     
    ad, Jun 19, 2005
    #1
    1. Advertisements

  2. ad wrote:

    > I have a string variable say:
    >
    > string sMyString="aeiou"
    >
    > How can I transfer sMyString into a char array?


    sMyString.ToCharArray()
    does that.

    --

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jun 19, 2005
    #2
    1. Advertisements

  3. ad <> wrote:
    > I have a string variable say:
    >
    > string sMyString="aeiou"
    >
    > How can I transfer sMyString into a char array?


    Please see the answers you received when you asked the same question
    yesterday.

    --
    Jon Skeet - <>
    http://www.pobox.com/~skeet
    If replying to the group, please do not mail me too
     
    Jon Skeet [C# MVP], Jun 19, 2005
    #3
  4. ad

    rossum Guest

    On Sun, 19 Jun 2005 19:38:39 +0800, "ad" <> wrote:

    >I have a string variable say:
    >
    >string sMyString="aeiou"
    >
    >How can I transfer sMyString into a char array?
    >


    Use sMyString.ToCharArray() as MuZZy/Andre indicated in his answer to
    your previous question on this subject.

    rossum



    The ultimate truth is that there is no ultimate truth
     
    rossum, Jun 20, 2005
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bill Todd

    How convert char array to string?

    Bill Todd, Dec 23, 2003, in forum: Microsoft C# .NET
    Replies:
    2
    Views:
    259
    Jay B. Harlow [MVP - Outlook]
    Dec 23, 2003
  2. ad

    How to separate a string into char array

    ad, Jun 18, 2005, in forum: Microsoft C# .NET
    Replies:
    2
    Views:
    261
  3. Replies:
    5
    Views:
    439
    Jon Skeet [C# MVP]
    Oct 15, 2005
  4. David
    Replies:
    3
    Views:
    375
    David
    Mar 17, 2006
  5. Guest
    Replies:
    4
    Views:
    295
    Guest
    Jun 11, 2007
  6. Aykut Ergin
    Replies:
    9
    Views:
    1,217
    Aykut Ergin
    Apr 15, 2008
  7. Replies:
    1
    Views:
    200
    Marc Gravell
    Aug 19, 2008
  8. mohaaron

    string.Replace((char)146, (char)39) does not work?

    mohaaron, Jan 30, 2010, in forum: Microsoft C# .NET
    Replies:
    3
    Views:
    2,436
    Peter Duniho
    Feb 1, 2010
Loading...