在下面的字符串中,我想计算第一个 \tCart 之前出现的单词数并忽略字符串的其余部分,我们该怎么做
 str1="hi\thello\thow\tare\tyou\tCart\tagain\tCart"
 output expected:5
 str1.count() ?????
在下面的字符串中,我想计算第一个 \tCart 之前出现的单词数并忽略字符串的其余部分,我们该怎么做
 str1="hi\thello\thow\tare\tyou\tCart\tagain\tCart"
 output expected:5
 str1.count() ?????