From Second Life Wiki
Revision as of 08:54, 13 July 2008 by Chaz Longstaff (Talk | contribs)

Jump to: navigation, search

Function: string left(string src, string divider);

Returns text left of a specified separator

See also: Right


string notecardparameter = left(sdata,"="); //in a notecard line that reads Colour=Brown, returns "Colour="


<lsl> string left (string src, string divider) {

      integer iStart = llSubStringIndex( src, divider ) + 1; 
      string result = llGetSubString( src, 0, iStart -1) ;//note -2 here if you don't want the divider included in what you get back
      return result;

} </lsl>