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
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 377

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: 2341
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: 377

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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Find carriage return in string value
 
Similar Threads
BASE64Encoder
Unicode Characters
remove carriage return from string
carriage return
Parsing XML data using SAXParser.