Barry Dogger
Posts: 7
Nickname: phoenix
Registered: Apr, 2002
|
|
Why does do I see spaces?
|
Posted: Apr 8, 2002 6:05 AM
|
|
Here is the part of load file what seems to contain the problem:
String line; while ( (line = bufferedReader.readLine()) != null) { Vector aLine = new Vector(); aLine.add(stringToVector(line)); System.out.println("what is aLine " +aLine ); data.addAll(aLine); }
System.out.println("what is aLine " +aLine ) output:
First Lastname, Street Nr., zip code, City, phone, mail
I do not want to have the space between the elements. I want it to look like: First Lastname,Street Nr.,zip code,City,phone,mail
Tokenizer I use :
public static Vector stringToVector(String string) { StringTokenizer tokenizer = new StringTokenizer(string, ",", false); Vector row = new Vector(); while(tokenizer.hasMoreTokens()) { String valueOfToken = tokenizer.nextToken(); row.addElement(valueOfToken); } return row; }
[[Willy Dogger, Wilgenhoek 51, 7681 RR, Vroomshoop, 0546-644539, w.dogger@home.nl]]
|
|