daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest Aug 21st, 2018 58 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. public Command getCommand(String string){
  2.         Explore explore = new Explore();
  3.        
  4.         String param;
  5.         int length;
  6.  
  7.         //if its the command EXPLORE
  8.         if(string.trim().toUpperCase().startsWith(commandList.get(9).getName())){
  9.             //find the length of the command
  10.             length=string.toUpperCase().length();
  11.             //get the next substring after the command Eplore (to find out the paramater of the command)
  12.             param = string.substring(length);
  13.             //and set it as the parameter of EXPLORE command
  14.             explore.setParams(param);
  15.             return commandList.get(9);
  16.              }
  17.  
  18.         for(int i=0;i<commandList.size();i++){
  19.             if(string.trim().toUpperCase().startsWith(commandList.get(i).getName()))
  20.                 return commandList.get(i);
  21.         }
  22.         return null;
  23.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top