File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Find carriage return in string value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Find carriage return in string value" Watch "Find carriage return in string value" New topic
Author

Find carriage return in string value

Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 387

I have textarea box in my web page and in my javacode I am needing to break up this string if the length of the string is more than 45 character or if a carriage return is found in the string.

My question is how do I find a carriage return in a string value?

Any suggestions or direction would be greatly appreciated.

Regards.
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
A carriage return is represented as a \r.
Srikanth Ramu
Ranch Hand

Joined: Feb 20, 2007
Posts: 76
For more details refer below link:

http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html
Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 387

Thanks for the help guys.

Regards.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Also note that a carriage return ('\r') is different than a newline ('\n') or form feed ('\f').


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
 
subject: Find carriage return in string value