Getting rid of Carriage returns
Getting rid of Carriage returns
- Subject: Getting rid of Carriage returns
- From: Calven Eggert <email@hidden>
- Date: Thu, 23 Dec 2004 14:46:31 -0500
Title: Getting rid of Carriage returns
Hi All,
I have text I want to export to an Excel file. The text for a field may have carriage returns in it so I need to remove them and replace them with spaces. I’ve used StringTokenizer and then I used the Class String replace method and they both are not working for me.
Here is my little routine:
public String removeReturns(String beforeStr) {
String tempStr = "";
StringTokenizer textTokens = new StringTokenizer(beforeStr, "\n", false);
while(textTokens.hasMoreTokens()) {
String aToken = (String)textTokens.nextToken();
tempStr += aToken;
}
return tempStr;
}
It doesn’t work. It still returns my string with the carriageretuns in it.
Can anyone help?
Calven
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden