Need to parse textbox values into an array of characters in Visual C #

Posted on 2009-02-17
Last Modified: 2012-05-06
I wish to assign the individual characters  in a textbox into an array of characters, buffer2 as follows:

I have the following textbox which has the value, "PLAIN" in it. I wish to assign each character in it to an array of characters, buffer2 so that buffer[0] = 'P', buffer[1]= 'L', buffer[2] = 'A' and so forth. Whatever I have tried, doesn't seem to work. Can someone show me a way to get it done? I either get index "out of bounds" error or  "cannot assign string to character" error.

Please help! Thanks.

Question by:geeta_m9
    1 Comment
    LVL 12

    Accepted Solution


    char[] buffer = System.Text.ASCIIEncoding.ASCII.GetChars(

    Open in new window


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now