java strings
|
|
scrooch
|
Thu May 15 2008, 01:52PM
|
|
|
Registered Member #908
Joined: Wed Jul 18 2007, 05:53AM
Location:
Posts: 49
|
i have some data in a file which im reading line by line. each line in the text file starts with a TABSPACE not a SPACE
how do i remove tab spaces from a string in java? i tried trim() but it did not work.
please help
|
Back to top
|
|
Steve Conner
|
|
Registered Member #30
Joined: Fri Feb 03 2006, 10:52AM
Location: Glasgow, Scotland
Posts: 6706
|
I assume by "tab space" you mean a tab character, or a tab character followed by a space character. So why not use replace() to replace all the tabs with spaces, before running it through trim()
|
Back to top
|
|
scrooch
|
|
Registered Member #908
Joined: Wed Jul 18 2007, 05:53AM
Location:
Posts: 49
|
thanks. i didnt know about the replace method before.
|
Back to top
|
|
Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob
|
|
Powered by e107 Forum System
|