Jump to content
  • 0

[HELP]About StringTokenizer


Question

Posted

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();

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • 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