public static String stripNewLineChar ( String pString ) { String tmpFidValue = pString ; StringTokenizer aTokenizer = new StringTokenizer ( pString , "\n" ) ; if ( aTokenizer . countTokens ( ) > 1 ) { StringBuffer nameBuffer = new StringBuffer ( ) ; while ( aTokenizer . hasMoreTokens ( ) ) { nameBuffer . append ( aTokenizer . nextToken ( ) ) ; } tmpFidValue = nameBuffer . toString ( ) ; } return tmpFidValue ; }
This method strips out all new line characters from the passed String .