gudii9
asked on
java string challenge to display
Hi,
I am working on below coding challenge
http://codingbat.com/prob/p130781
i wrote as below
I am working on below coding challenge
http://codingbat.com/prob/p130781
i wrote as below
public String right2(String str) {
return str.substring((str.length())-2)+str.substring(0,str.length()-2);
}
i would like to know how can improve on my above code. Please advise.Thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Open in new window
i like idea of creating variable to compute once as above