public static String removeFirstAndLastChar ( String text ) { Preconditions . checkNotNull ( text , "text can not be null" ) ; int n = text . length ( ) ; return text . substring ( 1 , n - 1 ) ; }
Remove first and last character from given string and return result .