View Single Post
Old Nov 19th, 2006, 3:43 AM   #3
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3 Jimbo is on a distinguished road
You could test string.indexOf('<')!=-1, or you could just use the contains method:
class bleh
{
  public static void main(String [] args)
  {
    String s = "something";
    String t = "something<else";
    if(s.contains("<"))
      System.out.println("\"" + s + "\" has a <");
    if(t.contains("<"))
      System.out.println("\"" + t + "\" has a <");

  }
}
output:
jimmy@vera ~/code/randomStuff $ java bleh
"something<else" has a <
__________________
<insert disclaimer here>
<insert shameless plug for Visual Studio here>
Jimbo is offline   Reply With Quote