I have 1 string which has to be between a specific range.
The range of the values are: "620/75R38" - "1050/50R38" as you guys can see, it should fit within the range. Yet i don't know how to put this in java code who can help me? I tried already with String.compareTo() function but somehow it doesn't give the right answeres.
EDIT
Here is what i've already tried.
private subMaat = "";
private maat = "650/65R38";
if(maat.contains("R")){
subMaat = maat.substring(0, maat.lastIndexOf("R"));
} else if (maat.contains("-")){
subMaat = maat.substring(0, maat.lastIndexOf("-"));
}
if(subMaat.compareTo("620/75") >= 0 && subMaat.compareTo("1050/50") <= 0){
//do something
}
Try this