Difference between revisions of "Substr"
From SDU
(fix missleading argument length.) |
Agegeleruvy (Talk | contribs) |
||
| Line 1: | Line 1: | ||
| + | ---- | ||
| + | <div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;"> | ||
| + | ---- | ||
| + | =[http://aduratutuz.co.cc This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page]= | ||
| + | ---- | ||
| + | =[http://aduratutuz.co.cc CLICK HERE]= | ||
| + | ---- | ||
| + | </div> | ||
__NOTOC__ | __NOTOC__ | ||
[[Category:Customizations]] | [[Category:Customizations]] | ||
| Line 22: | Line 30: | ||
string otherString; | string otherString; | ||
| − | otherString = | + | otherString = "this is a string"; |
| − | myString = substr(otherString,sindex(otherString, | + | myString = substr(otherString,sindex(otherString,"a")); |
| − | // myString == | + | // myString == "a string" |
| − | myString = substr(otherString,sindex(otherString, | + | myString = substr(otherString,sindex(otherString,"is",4)); |
| − | // myString == | + | // myString == "is a" |
Revision as of 03:30, 24 November 2010
To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.
To discuss or ask questions about this article, select the discussion tab above.
Overloaded method to return a string within a string
string substr(string str, int start, int length)
string substr(string str, int start) // reads to the end of the string for finish
Can be used in conjuction with sindex to retrieve start index.
eg.
string myString;
string otherString;
otherString = "this is a string";
myString = substr(otherString,sindex(otherString,"a"));
// myString == "a string"
myString = substr(otherString,sindex(otherString,"is",4));
// myString == "is a"