Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский
Scilab Help >> Strings > strstr


Tail of a string starting from the 1st occurrrence of a given fragment


Tail = strstr(Strings, StartingFragment)


Strings, StartingFragment, Tail

Matrices of strings, of identical dimensions. StartingFragments can be a single string. It is then used for all Strings components.


Tail = strstr(Strings, StartingFragment) builds and returns a matrix of strings such that, for each element Strings(i), Tail(i) is the part of Strings(i) starting from the first occurrence of startingFragment(i), up to the end of Strings(i).

If StartingFragment(i) is not found in Strings(i), Tail(i) is set to "".


strstr('This is a simple string','simple')
strstr('This is a simple string','sample')
strstr(['This is a simple string','in scilab'],'is')
strstr(['This is a sample string','in scilab'],['a','scilab'])

See also

  • strrchr — find the last occurrence of a character in a string
  • strchr — find the first occurrence of a character in a string
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Jan 03 14:23:29 CET 2022