I am working on an application that churns output based on comparison of string input. I realize however that most modes of comparison are not applicable to strings. By these I am referring to:
- less than(<)
- less than and equal to(<=)
- greater than(>)
- greater than and equal to(>=)
- equal to(==)
Is there a workaround that anyone might know about? I would appreciate any advice.
Thanks.
[RE-EDIT]
My application is a form that includes various fields. For instance when one enters a value in one textfield, that value is compared against a target value based on the conditions I listed above. And based on the result, execution can proceed.
I hope this sheds some light.
If you have strings containing nummeric values you should try parsing them to a nummeric representation first. I.e.:
for simple equals comparision there is the
String.equalsmethod: