L
Li Chen
Hi all,
I try to split a line that is separated by 'tab' and expect return an
array with all the elements containing empty space. But my code doesn't
work. Any idea?
Thanks,
Li
C:\Documents and Settings\chen41\Desktop>irb
irb(main):001:0> s='\t\t\t\t\t\t\t\t'
=> "\\t\\t\\t\\t\\t\\t\\t\\t"
irb(main):002:0> s.split(/\t/)
=> ["\\t\\t\\t\\t\\t\\t\\t\\t"]
irb(main):003:0> s.split(/\\t/)
=> []
irb(main):004:0>
I try to split a line that is separated by 'tab' and expect return an
array with all the elements containing empty space. But my code doesn't
work. Any idea?
Thanks,
Li
C:\Documents and Settings\chen41\Desktop>irb
irb(main):001:0> s='\t\t\t\t\t\t\t\t'
=> "\\t\\t\\t\\t\\t\\t\\t\\t"
irb(main):002:0> s.split(/\t/)
=> ["\\t\\t\\t\\t\\t\\t\\t\\t"]
irb(main):003:0> s.split(/\\t/)
=> []
irb(main):004:0>