This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes leading zero in String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "leading zero in String" Watch "leading zero in String" New topic
Author

leading zero in String

anjali ray
Greenhorn

Joined: Mar 12, 2005
Posts: 28
I have a string which has a zero in the beginning.
For example 01254.
When I write it into a file using BufferedWriter the 0 in the beginning is dropeed and onlu 1254 is written.
How can I write the whole 01254 in the file.
Any help will be highly appreciated.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
Which method of the BufferedWriter are you using? How are you getting 01245 into the String in the first place?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: leading zero in String
 
Similar Threads
add text to a .txt file
string manipulation
Math.rint() and seek()
Write an XML file with SAX?
searching for "\d*" in a string