title: Parse a string, create single strings and compare them to a value in an if statement?
body: <p>I'm trying to do something that might seem simple do you but I'm kind of stuck and I can't wrap my head around how to do it.</p>
  
  <p>So basically what I want to do is parse string str and create smaller strings and compare them to something in an if statement</p>
  
  <pre><code>    String str = ("1, 2, 3);
      StringTokenizer st = new StringTokenizer(str, ",");
      while (st.hasMoreElements()){
          //instead of printing the element I want to generate str[i] or something of the sort
          System.out.print(st.nextElemenet());
      }
  
      //then I want to do this as many times as I have str[i]
      if(str1 == 2 || str2 == 3 || str3 == 3){
      //do something
      }
  </code></pre>
  
  <p>Basically I want to parse a string, generate a bunch of smaller strings and use them in an if statement. Any ideas? Sorry if it seems like a simple question but I'm kind of stuck lol</p>
  
  <p>PS Java 1.4 doesn't support .split and it needs to be in java 1.4 ^_^
  I can make an ArrayList but I'm still not sure how to iterate through it in the if, comparing all the values of it with a given value. :/</p>