StringPosition
Usage
• StringPosition["string", "sub"] 返回由"sub"作为"string"的子字符串时的起始和结束字符位置构成的列表.
• StringPosition["string", "sub", k] 只返回出现"sub"的前 k 个位置.
• StringPosition["string", " ", " ", ... ] 返回所有 " "的位置.
Notes
• 例如: StringPosition["abbaabbaa", "bb"]  . • 在缺省设置Overlaps -> True下, StringPosition 包含交迭的子字符串. 在设置Overlaps -> False下,这些子字符串不包含在内. • 选项IgnoreCase -> True设置使得StringPosition 把大小写字母看作是等同的. • 例如: StringPosition["abAB", "a", IgnoreCase -> True]  . • StringPosition 以StringTake, StringDrop 和 StringReplacePart所使用的形式返回序列指定.
Further Examples
The letter "t" occurs in the  and  positions of this string.
In[1]:=
|
Out[1]=
|
|