Jump to content
  • 0

[HELP]About StringTokenizer


down

Question

Can some1 explain me why this god damn Tokenizer doesnt work with this:

public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
   if (command.equalsIgnoreCase("countppl")) {
   StringTokenizer st = new StringTokenizer(target);

   String char1 = "";
   String char2 = "";
   String char3 = "";
   String char4 = "";

   if (st.hasMoreTokens()) char1 = st.nextToken();
   if (st.hasMoreTokens()) char2 = st.nextToken();
   if (st.hasMoreTokens()) char3 = st.nextToken();
   if (st.hasMoreTokens()) char4 = st.nextToken();

   activeChar.sendMessage("Selected: 1:"+char1+", 2:"+char2+", 3:"+char3+", 4:"+char4);
}

 

count.jpg

 

 

Same goes for:

            StringTokenizer st = new StringTokenizer(command, " ");
            st.nextToken();

 

and

 

            StringTokenizer st = new StringTokenizer(command);
            st.nextToken();

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock