Difference between revisions of "Substr"

From SDU
Jump to: navigation, search
(fix missleading argument length.)
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 = "this is a string";
+
otherString = &quot;this is a string&quot;;
  
myString = substr(otherString,sindex(otherString,"a"));
+
myString = substr(otherString,sindex(otherString,&quot;a&quot;));
  
// myString == "a string"
+
// myString == &quot;a string&quot;
  
myString = substr(otherString,sindex(otherString,"is",4));
+
myString = substr(otherString,sindex(otherString,&quot;is&quot;,4));
  
// myString == "is a"
+
// myString == &quot;is a&quot;

Revision as of 03:30, 24 November 2010



This Page Is Currently Under Construction And Will Be Available Shortly, Please Visit Reserve Copy Page


CLICK HERE


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.

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"