I have string variable where at certain times the variable has "+" or "#" characters at the end of the string. I want to remove these characters from the end of the string. I wrote the following code but it doesn't work. The code compiles and the else command works but the if and if else statements do not work. Thank you for your help
if (konHamle.contains("+") )
{
int kont1 = konHamle.indexOf("+");
hamHamle = konHamle.substring(0, konHamle.length() - 1);
break;
}
else
{
hamHamle = konHamle;
break;
}