Hi I am having some issues with some simple conditions on an if statement when using 'or' to define the action, the below is an example that will have as a result a string with eleven characters, however for some reason the else if statement keep been excecute when that is not correct
Doesnt have apex the functionality of using this 'or' inside and if statement? however when using the code below on the developer console I dont get any error and it is been exccecuted. So I dont understand what is going on
string a = 'test string';
integer b;
b = a.length();
if(b <= 2){
system.debug('b is less or equal to 2');
}else if(b > 2 || b<5){
system.debug(b + ' is in between 2 and 5');
}else{
system.debug('definetly longer than 5');
}
the result:
Thanks