Arrays

javascript India
  • 19 years ago

    Hi All,


    I have a string like String str="10,11,12,13".
    I want to create an integer array from this str.
    That means I want to create an array like int Arr={10,11,12,13} using variable str.


    Anybody can help me.


    Thanks in Advance


    Riaz

  • 19 years ago

    how about


    Arr = str.split (",");

  • 19 years ago

    Hi James,


    I solved it using StringTokenizer. I created an array of type ArrayList.
    And I added all elements one by one. And created an object array from this array.


    Thanks


    Riaz

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Linux is only free if your time has no value” - Jamie Zawinski