wood burning stoves*
The moose likes Beginning Java and the fly likes how to use if statment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to use if statment" Watch "how to use if statment" New topic
Author

how to use if statment

deepika deepi
Ranch Hand

Joined: Jan 23, 2012
Posts: 199
hi,

i have an regular expression like this " sym : symbol : (\.|\,|\-)". Here name is symbol and regX is (\.|\,|\-)/(\.|\,|\-) should be equal to regX_hash else regX_hash should be equal to regX is (\.|\,|\-)

Using if case i would like to get an output like this
System.out.println("Result "+regX_hash);

OUTPUT: Result (\.|\,|\-)

if(name == "symbol") {

}else{

}


How to apply this and get the result. I am unable to reach the designation.
Puneet N Vyas
Ranch Hand

Joined: Sep 20, 2007
Posts: 61
Hi,
you are doing String comparison with == ?
deepika deepi
Ranch Hand

Joined: Jan 23, 2012
Posts: 199
hi Puneet N Vyas vyas,

i need an value comparison
Puneet N Vyas
Ranch Hand

Joined: Sep 20, 2007
Posts: 61
Hi,
use string builder and regex comparison method.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36497
    
  16
You should know about the equals() and equalsIgnoreCase() methods.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to use if statment
 
Similar Threads
== doubt
How to cut string into equal length peaces?
Reading A Javabean in JSTL
JUnit tests for Getters and Setters
How to get or replace the backslash in Java string