Link to home
Start Free TrialLog in
Avatar of fylix0000
fylix0000

asked on

Read String part and store in array.

Hi, I have in.readLine() function give me the following string:
 "143586371377.0'0'1'asdf'6'EDITOR@WEB'0502'20060310'23532'1411.92'ALL'0.06'EFTO'AS400234234''0'0.06#"

I try to read in the 143586371377.0 and store in element[0], 0 in element[1] and so forth, basically it store the element between the single quote into array.  If I have 2 single quote such as '' then i would store NULL.

My fields has many of these and they each start in a new line such as  (though with different content ofcourse) with # denote end of line, I can remove the # as well if needed.

 143586371377.0'0'1'asdf'6'EDITOR@WEB'0502'20060310'23532'1411.92'ALL'0.06'EFTO'AS400234234''0'0.06#
 143586371377.0'0'1'asdf'6'EDITOR@WEB'0502'20060310'23532'1411.92'ALL'0.06'EFTO'AS400234234''0'0.06#
 143586371377.0'0'1'asdf'6'EDITOR@WEB'0502'20060310'23532'1411.92'ALL'0.06'EFTO'AS400234234''0'0.06#
 143586371377.0'0'1'asdf'6'EDITOR@WEB'0502'20060310'23532'1411.92'ALL'0.06'EFTO'AS400234234''0'0.06#
SOLUTION
Avatar of hoomanv
hoomanv
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
:-)

Actually i'm not sure it's even possible to get a null token, but you should probably eat up any slack space, so you'd probably be better doing:

 if (x[y] == null || (x[y] = x[y].trim()).length() == 0)