×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    158

    string array to string

    how to convert string array[] in to single string..is der any func?

    explain with a code plz?

    thanks in advance

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: string array to string

    All the methods for strings are in the String and StringBuffer classes. They are listed and explained in the documentation.

    No, there is no specific method for this. You must write a loop to concatenate them. I suggest you use a StringBuffer, and append each String in turn.

  3. #3
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    158

    Re: string array to string

    actually i want to extract a sub string(name) from string buffer....wat function to use... have to finish dis work today..pl help

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: string array to string

    All the information you want is in the JavaDocs. Reading the documentation would be good plan. There isn't that much to read.

    You convert a StringBuffer to a String by using toString().

    You extract a substring by (guess what) myString.substring(begin, end).

    You will find these answers much faster by looking in the documentation.

  5. #5
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    158

    Re: string array to string

    ya....but these name dynamically changes......

  6. #6
    Nokia Developer Champion
    Join Date
    Sep 2007
    Posts
    915

    Re: string array to string

    Quote Originally Posted by jselvakumar26071988 View Post
    ya....but these name dynamically changes......
    Even if it dynamically changes the functions will use current value. Please include more details if possible.

  7. #7
    Regular Contributor
    Join Date
    Sep 2008
    Posts
    158

    Re: string array to string

    substring(1,6);
    if in the second time,name changes to long sequence(15 characters)

  8. #8
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: string array to string

    Perhaps you could give us some examples of strings...

    But I'm guessing you want to use String.indexOf()

    Seriously, read the JavaDocs for the String class, you will find what you need.

Similar Threads

  1. byte array / string / sha 1 problem
    By nuker85 in forum Mobile Java General
    Replies: 1
    Last Post: 2008-02-28, 07:45
  2. Replies: 5
    Last Post: 2006-02-26, 17:29
  3. How to read array of string from resource file
    By ericcwhung in forum Symbian
    Replies: 6
    Last Post: 2005-08-29, 12:03
  4. Personal
    By JSmith77 in forum PersonalJava
    Replies: 4
    Last Post: 2003-07-30, 12:52
  5. D211 new linux driver 1.04 not working !!
    By franz_meyer in forum Multimodecards
    Replies: 1
    Last Post: 2002-12-12, 08:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×