English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hi I have a textfile like "Hello world"How are you". I wanna put these in an array as arr1 = Hello world arr2 = How are you. I am trying to use the split function but it doest work for this delimeter. Supposing it was hello world,how are you the split function works fine. For the latter the code is
a.split(",") . but when splitting from " a.split(""") is giving syntax error. Have tried the escape characters as well like a.split("\"") , a.split("/"") , but all in vain.. Help appreciated.

Thanks

2007-05-03 00:10:01 · 2 answers · asked by neo_bourne_21 2 in Computers & Internet Programming & Design

2 answers

I think you need an escape in front of every quote you wish to use as a delimiter..

"""" becomes \"\"\"\"

Then encase above in quotes "\"\"\"\""

2007-05-03 00:39:36 · answer #1 · answered by MarkG 7 · 1 0

Try using the ASCII value

a.split(chr(34))

2007-05-03 03:33:08 · answer #2 · answered by rod 6 · 0 0

fedest.com, questions and answers