I'm new to Python and am having trouble with a seemingly simple objective. I've tried several methods for splitting a string by a tab character to no avail.
testStr = 'word1 word2'
values = testStr.split("\t")
print(values)
Results in
['word1 word2']
and
import re
testStr = 'word1 word2'
print(str(re.search(r'[^\t]', testStr).start()))
results in
0
Used the answers from the following posts:
How to get the first word in the string
splitting a string based on tab in the file
Any help appreciated.