-
Splitting a String
Does java have a function that can split the string into an array where each element is a character of that string so like
"abc" -> [0] => a [1] => b [2] => c ?
I looked at the split function, but that seems to need something to seperate by like a comma.
I was thinking doing a for loop like:
String myString = "abc";
int len = length(myString);
int i;
for(i=0; i<=len; i++)
{
b[] = myString.substring(i, i+1)
}
Im sure that this is prolly not the right syntax though, that is mostly what I am having trouble with because I've already worked a lot with php and am trying to learn java.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks