2021年3月12日星期五

Detecting the substring from string of first detecting word

I am trying to detect the first character from a string and detect it until the next word appears.

For example: Str = 'xDxxzacBxsxsZxxs' and Set = 'DBZ' Output should be, output = 'xDxxzacBxsxsZ'

I am trying below code but not able to detect the words related to Set.

def F(S, T):      for t in T:          if t not in S: return False      Start=T[t] // error here, I am trying to get the index  Str = 'xDxxzacBxsxsZxxs'  Set = 'DBZ'  F(Str,Set)  
https://stackoverflow.com/questions/66609961/detecting-the-substring-from-string-of-first-detecting-word March 13, 2021 at 11:52AM

没有评论:

发表评论