right

From Second Life Wiki
Revision as of 10:43, 2 May 2011 by Zai Lynch (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Summary

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

Returns text right of a specified separator
Returns a string that is the text in src that is right of the first occurrence of divider.

• string src
• string divider

If divider is not found then src is returned in it's entirety.

See also: Left

Specification

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

   integer index = llSubStringIndex( src, divider );
   if(~index)
       return llDeleteSubString( src, 0, index + llStringLength(divider) - 1);
   return src;

}</lsl>

Examples

<lsl>string value = right("Colour=Brown", "="); //value == "Brown"</lsl>