Mathematica 9 is now available

StringTake

Usage

StringTake["string", n] 返回由"string"中前 n个字符构成的字符串.
StringTake["string", -n] 返回由"string"中后 n个字符构成的字符串.
StringTake["string",  n ] 返回"string"中第 n个字符.
StringTake["string",  m, n ] 给出"string"中从mn位置的字符构成的字符串.


Notes

StringTake 使用标准的序列指定 (参见 A.3.5节).
• 例如: StringTake["abcdefg", 3]LongRightArrow .
StringTake["string",  m, n, s ] 以步长 s返回从mn位置的字符.
• 参见 Mathematica 全书: 2.7.2节.
• 同时参见: Take, StringDrop, StringPosition.
Further Examples

This takes  characters starting from the end of the string.

In[1]:=  

Out[1]=

This takes the character at position 5.

In[2]:=  

Out[2]=

This takes the characters  through  .

In[3]:=  

Out[3]=

This takes characters  through  in steps of  .

In[4]:=  

Out[4]=



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.