Code example for StringTokenizer

Methods: countTokens, nextToken

0
	{ 
		// BypassValidation Exploit plug. 
		if (player.getLastFolkNPC().getObjectId() != getObjectId())
			return; 
		 
		StringTokenizer st = new StringTokenizer(command, " ");
		String actualCommand = st.nextToken(); // Get actual command
		 
		String par = "";
		if (st.countTokens() >= 1)
			par = st.nextToken();
		 
		if (actualCommand.equalsIgnoreCase("Chat"))
		{ 
			int val = 0;
			try 
			{ 
				val = Integer.parseInt(par);
			} 
			catch (IndexOutOfBoundsException ioobe){}
			catch (NumberFormatException nfe){}