OsMatchString

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m
m (Remove unused var)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{| width="100%" style="border: thin solid black"
+
{{osslfunc
| colspan="2" align="center" style=background:orange | '''{{SUBPAGENAME}}'''
+
|threat_level=High
|- valign="top"
+
|function_syntax=list osMatchString(string src, string pattern, integer start)
|'''Threat Level''' || High
+
|ossl_example=<source lang = "lsl">
 +
// ----------------------------------------------------------------
 +
// Example / Sample Script to show function use.
 +
//
 +
// Script Title:    osMatchString.lsl
 +
// Script Author:
 +
// Threat Level:    High
 +
// Script Source:  SUPPLEMENTAL http://opensimulator.org/wiki/osMatchString
 +
//
 +
// Notes: See Script Source reference for more detailed information
 +
// This sample is full opensource and available to use as you see fit and desire.
 +
// Threat Levels only apply to OSSL & AA Functions
 +
// See http://opensimulator.org/wiki/Threat_level
 +
// ================================================================
 +
// Inworld Script Line:   list osMatchString(string src, string pattern, integer start);
 +
//
 +
// Example of osMatchString
 +
//
 +
default
 +
{
 +
    state_entry()
 +
    {
 +
        llSay(PUBLIC_CHANNEL, "Touch me to show Matched Strings");
 +
    }
  
|- valign="top"
+
    touch_end(integer total_number)
|'''Function Syntax''' || <source lang="lsl">
+
    {
osMatchString(string src, string pattern, integer start);
+
        string sSentence = "today we do this all day long and all night long";
 +
        list lMatches = [];
 +
        lMatches = osMatchString(sSentence, "all", 0);
 +
        llSay(0,"Matched String :\n"+llDumpList2String(lMatches, " @ "));
 +
    }
 +
}
 
</source>
 
</source>
|- valign="top"
+
|description=This function returns a list containing the matches from the given string.
|'''Example(s)||
+
|
 
+
}}
|}
+
 
+
This function returns a list containing the matches from the given string.
+
 
+
[[Category:OSSL Functions]]
+
[[Category:OSSL functions without example]]
+

Latest revision as of 12:44, 16 October 2019

list osMatchString(string src, string pattern, integer start)
This function returns a list containing the matches from the given string.
Threat Level High
Permissions No permissions specified
Extra Delay No function delay specified
Example(s)
// ----------------------------------------------------------------
// Example / Sample Script to show function use.
//
// Script Title:    osMatchString.lsl
// Script Author:
// Threat Level:    High
// Script Source:   SUPPLEMENTAL http://opensimulator.org/wiki/osMatchString
//
// Notes: See Script Source reference for more detailed information
// This sample is full opensource and available to use as you see fit and desire.
// Threat Levels only apply to OSSL & AA Functions
// See http://opensimulator.org/wiki/Threat_level
// ================================================================
// Inworld Script Line:    list osMatchString(string src, string pattern, integer start);
//
// Example of osMatchString
//
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Touch me to show Matched Strings");
    }
 
    touch_end(integer total_number)
    {
        string sSentence = "today we do this all day long and all night long";
        list lMatches = [];
        lMatches = osMatchString(sSentence, "all", 0);
        llSay(0,"Matched String :\n"+llDumpList2String(lMatches, " @ "));  
    }
}
Personal tools
General
About This Wiki