Hi Guys,
Please show me how to replace enter characters in a string:afrog:
Printable View
Hi Guys,
Please show me how to replace enter characters in a string:afrog:
String.replace
Hi ComputerJy,
Thanks. But I need to know what the enter chracter is.Will it be Chr(10) for example.
If its a typical text file then you can use string.replaceAll on the carriage return + line feed combination (use regex). try "\\n" first as the pattern.. if that doesn't work try "\\r" or "\\r\\n"
Where str is a String instance, notice that the line.separator property differs between OSs (\n in unix & \r\n in windows).Code:str.replace(System.getProperty("line.separator"), "NewLine");
You can also use the \n character directly
thanks a lot guys. That is exactly what I needed:)