P4_HardyTrent_C11_frontBack.java
/* Given a string return a new string where the first and last chars have been exchanged.
	 * frontBack("code") becomes "eodc"
	 * frontBack("a") becomes "a"
	 * frontBack("KleinCollins") becomes "sleinCollinK"
	 * frontBack("TrentHardy") becomes "yrentHardT"
	 * Note: You will need to replace my name with your full name
	 * 	without any spaces.
	 * Note: I put the moved main to the bottom of the code
	 * 	this was to show you it can be done
	 *	and that the code will run fine.
	 *	in later lessons when I create objects from classes
	 *	you should appreciate why I changed my format.	*/
Given a string return a new string where the first and last chars have been exchanged.
Given a string return a new string where the first and last chars have been exchanged .
static String frontBack(String str) {
		if (str.length() <= 1) return str;
		String mid = str.substring(1, str.length()-1);
		return str.charAt(str.length()-1) + mid + str.charAt(0);
	}
static String frontBack ( String str ) { if ( str . length ( ) <= 1 ) return str ; String mid = str . substring ( 1 , str . length ( ) - 1 ) ; return str . charAt ( str . length ( ) - 1 ) + mid + str . charAt ( 0 ) ; }
Given a string return a new string where the first and last chars have been exchanged.
Given a string return a new string where the first and last chars have been exchanged .
// store the middle part of the word to use with your
 // Concatenate last and mid and first together
