I have an if-else branching like
if(name.contains(substring)){
if(name.contains(substring1)){
return "this";
}else if(name.contains(substring2)){
return "that";
}
...
}else if(){
// if else ladder
}
....//else if ladder continues
else{
return "them"
}
What is the best way to refactor this? That what is the most efficient way to make logic like this?
Aucun commentaire:
Enregistrer un commentaire