How can I convert array into string object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • to_rgoyal@yahoo.com

    How can I convert array into string object

    Hi All,
    I want to convert array into string. That is, I have one character
    array with number of characters like :
    arr[0]='0'
    arr[1]='5'
    arr[2]='/'
    arr[3]='1'
    arr[4]='2'
    arr[5]='/'
    arr[6]='2'
    arr[7]='0'
    arr[8]='0'
    arr[9]='5'

    Iwant to store these values into string object. So that it become :
    String str="05/12/2005";

    How can I do that? I tried with

    string date=arr.ToStri ng();

    But it doesn't work. Please help me.

  • Ignacio Machin \( .NET/ C# MVP \)

    #2
    Re: How can I convert array into string object

    Hi,

    Easier than that, string s = new String ( arr );


    cheers,

    --
    Ignacio Machin,
    ignacio.machin AT dot.state.fl.us
    Florida Department Of Transportation


    <to_rgoyal@yaho o.com> wrote in message
    news:1117627454 .518834.149800@ o13g2000cwo.goo glegroups.com.. .[color=blue]
    > Hi All,
    > I want to convert array into string. That is, I have one character
    > array with number of characters like :
    > arr[0]='0'
    > arr[1]='5'
    > arr[2]='/'
    > arr[3]='1'
    > arr[4]='2'
    > arr[5]='/'
    > arr[6]='2'
    > arr[7]='0'
    > arr[8]='0'
    > arr[9]='5'
    >
    > Iwant to store these values into string object. So that it become :
    > String str="05/12/2005";
    >
    > How can I do that? I tried with
    >
    > string date=arr.ToStri ng();
    >
    > But it doesn't work. Please help me.
    >[/color]


    Comment

    Working...