Difference between revisions of "S2 Cookbook: Strings"
From Dreamwidth Notes
Foxfirefey (Talk | contribs) (Created page with '== Get the length of a string == <syntaxhighlight lang="s2"> var string x = "stylish"; # Get the length of our example string var int length = $x->length(); # Print out what the…') |
Foxfirefey (Talk | contribs) m |
||
Line 29: | Line 29: | ||
== Repeating a string == | == Repeating a string == | ||
+ | |||
+ | [[Category: S2 Cookbook]] |
Revision as of 07:33, 17 June 2010
Contents
Get the length of a string
var string x = "stylish"; # Get the length of our example string var int length = $x->length(); # Print out what the length is print """The length of "$x" is $length."""
Will print out:
The length of "stylish" is 7.
Finding a string in another string
var string foxy = "I am a quick brown fox.";