private String removeTrailingPeriod(String val){
  if (val.charAt(val.length() - 1) == '.') {
    val=val.substring(0,val.length() - 1);
  }
  return val;
}

private String removeTrailingPeriod ( String val ) { if ( val . charAt ( val . length ( ) - 1 ) == '.' ) { val = val . substring ( 0 , val . length ( ) - 1 ) ; } return val ; }
removes the trailing period
