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@WE B'0502'200 60310'2353 2'1411.92' ALL'0.06'E FTO'AS4002 34234''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'2006 0310'23532 '1411.92'A LL'0.06'EF TO'AS40023 4234''0'0. 06#
143586371377.0'0'1'asdf'6' EDITOR@WEB '0502'2006 0310'23532 '1411.92'A LL'0.06'EF TO'AS40023 4234''0'0. 06#
143586371377.0'0'1'asdf'6' EDITOR@WEB '0502'2006 0310'23532 '1411.92'A LL'0.06'EF TO'AS40023 4234''0'0. 06#
143586371377.0'0'1'asdf'6' EDITOR@WEB '0502'2006 0310'23532 '1411.92'A LL'0.06'EF TO'AS40023 4234''0'0. 06#
"143586371377.0'0'1'asdf'6
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'
143586371377.0'0'1'asdf'6'
143586371377.0'0'1'asdf'6'
143586371377.0'0'1'asdf'6'
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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)