public static String escape ( String pArg , String pEscape , String pDelimiter ) { return pArg . replaceAll ( pEscape , pEscape + pEscape ) . replaceAll ( pDelimiter , pEscape + pDelimiter ) ; }
Escape the delimiter in an argument with the given escape char .