gemini dev wrote:Hi All,
I have created a simple code where I'd like to remove/ replace more thn 2 white space char with 2 whitespace chars.
this is working fine in my local environment but not at the production server
------------------
private String formatLine(String strLine)
{
if(strLine != null)
{
strLine = strLine.replaceAll(" +", " ");
}
return strLine;
}
------------------
I have checked the Java version and both are running JDK 1.5.
please help,
Thanks,
Vikas
the previous answer, "use replace" is a little off as String.replace() does not use regular expressions, so it could work if you said
replace (" "," ")
I don't know why your code is working in one place and not the other. What are the results you are seeing?