次の文字列では、最初の\ 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() ?????