LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-18-2010, 07:19 PM   #1
swedenkhan
LQ Newbie
 
Registered: Aug 2010
Posts: 1

Rep: Reputation: 0
Question help me plz


hello,
i have problem in java.
how to convert string array to character.
e.g
string a[]={"ab","abc","abd","ag"};
what will be the character array ??????????
thanks for your time
 
Old 08-18-2010, 08:13 PM   #2
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,762

Rep: Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465Reputation: 1465
First, please change your subject to something more appropriate. I suggest "converting Java string arrays to character arrays."

Second, two question:
  1. is this homework?
  2. what should the end result be?

I really don't have a clear picture of what you're trying to end up with. However, it looks like coming up with the solution yourself (hint: Java's API documentation describes the String class' toCharArray method) might be easier than explaining it more clearly. When you do have a solution, post it.

Last edited by dugan; 08-18-2010 at 08:18 PM.
 
Old 08-18-2010, 09:17 PM   #3
John VV
Guru
 
Registered: Aug 2005
Posts: 13,031

Rep: Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740Reputation: 1740
this sounds like homework

but , by chance it is not .
PLEASE
give the REAL real world problem you are having
 
Old 08-18-2010, 09:18 PM   #4
vigilandy
Member
 
Registered: Mar 2010
Location: Tokyo
Distribution: Arch, Fedora
Posts: 71

Rep: Reputation: 23
Quote:
Originally Posted by swedenkhan View Post
string a[]={"ab","abc","abd","ag"};
This will create an array of strings where a[0] is the string "ab", a[1] is "abc", etc.

what you may be looking for is
Code:
char[] myArr = "abc".toCharArray();
 
  


Reply

Tags
java


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PLZ, PLZ help - need some info kevmif Linux - General 9 12-17-2007 06:12 AM
plz plz help me regarding route mapping nedian123 Programming 1 07-13-2004 08:17 AM
plz plz solve my route mapping problem nedian123 Linux - Networking 1 07-12-2004 09:41 PM
plz, help me (plz realy ) h4ng4m3 Linux - General 10 08-18-2003 06:07 AM
redhat problems plz plz help sap666 Linux - Newbie 5 07-30-2003 10:57 AM


All times are GMT -5. The time now is 07:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration