StringDrop

StringDrop["string",n]
gives with its first n characters dropped.

StringDrop["string",-n]
gives with its last n characters dropped.

StringDrop["string",{n}]
gives with its n^(th) character dropped.

StringDrop["string",{m,n}]
gives with characters m through n dropped.

StringDrop[{s1,s2,},spec]
gives the list of results for each of the .

DetailsDetails

  • StringDrop["string",{m,n,s}] drops characters m through n in steps of s.
  • StringDrop uses the standard Wolfram Language sequence specification.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Drop the first 4 characters from a string:

In[1]:=
Click for copyable input
Out[1]=

Use InputForm to show quotes:

In[2]:=
Click for copyable input
Out[2]//InputForm=

Drop from the end of the string:

In[1]:=
Click for copyable input
Out[1]=

Drop characters 5 through 10:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 1991
(2.0)
| Updated in 2004
(5.1)