| | |
Tokenize
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2007
Posts: 46
Reputation:
Solved Threads: 0
I am having a problem with tokenizing "wddw". I can tokenize if they is a sign like (,). How can I tokenize this without getting an error. I have tried charAt(0), but it only gives me the first character.
I want each character to be stored separately. I know about split, but I need to use tokenizer
I want each character to be stored separately. I know about split, but I need to use tokenizer
public static void main(String [] args)
{
String temp = "wddw";
StringTokenizer st = new StringTokenizer(temp);
while (st.hasMoreTokens())
{
char del;
String com = st.nextToken();
int x = com.lastIndexOf(com);
del = com.charAt(0);
System.out.println(del);
} i think it is better to use character array to store each character and get it....sample syntax is like this..... So that you can get as each character.......
Java Syntax (Toggle Plain Text)
char[] i=new char[10]; String u = (String) stoke.nextToken(); i= u.toCharArray();
![]() |
Similar Threads
- tokenize an input text file.. (Java)
- Parse or Tokenize String (C++)
- how to tokenize a long string by using another string (Java)
- Is there a way to tokenize an array of strings (C++)
- Listing words in an Array of text (C++)
- help on using StringTokenizer to read and compute multiple lines from text (Java)
- Scanf Equivalent (Java)
- Conver int Array into a String (Java)
- string translation (Java)
Other Threads in the Java Forum
- Previous Thread: Need help with a homework assignment.
- Next Thread: need help with this "method" problem
Views: 791 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Java
2dgraphics android api apple applet application arguments array arrays automation banking binary binarytree bluetooth chat chatprogramusingobjects class classes client code component database derby design draw eclipse encryption error event exception file fractal game givemetehcodez graphics gui helpwithhomework html ide if_statement image input integer interface j2me java javadesktopapplications javaprojects jlabel jmf jni jpanel julia linux list loop map method methods mobile multithreading netbeans newbie nullpointerexception number object open-source oracle print printing problem program programming project property recursion reference remove scanner screen server set size sms socket sort splash sql stop string swing test threads time transfer tree ui unicode validation windows





