Login +

Documentation

SLS_String::trimWordFromString

Since SillySmart 1.0

Description

Delete the first or the last word of a string
static string trimWordFromString ( string $string, [ bool $start ] );

Parameters

  • string $string
    the string to 'amputate'
  • bool $start
    true if you want to cut the first word, else false for the last word

Return

string $trimmed
the string cut

Exemples

  •  var_dump(SLS_String::trimWordFromString("software is like sex, it's better when it's free"));
     // will produce : "is like sex, it's better when it's free"
  •  var_dump(SLS_String::trimWordFromString("software is like sex, it's better when it's free",false));
     // will produce : "software is like sex, it's better when it's"

Comments

No comment on this function, be the first !

Add your comment

You must login/register to post a reply.