Difference between revisions of "SHIP:Data Types:String"

From Serious Documentation
Jump to: navigation, search
({{DataType|String}})
Line 13: Line 13:
 
|}</onlyinclude>
 
|}</onlyinclude>
  
 +
== Examples ==
 
String constants are written in [[SHIP:Sail|Sail Scripts]] enclosed in double quotes (&quot;), for example  
 
String constants are written in [[SHIP:Sail|Sail Scripts]] enclosed in double quotes (&quot;), for example  
  
   <code>"hello"</code>
+
   <code>text.value = "hello";</code>
  
 
and can be concatenated with the "+" operator, for example  
 
and can be concatenated with the "+" operator, for example  
  
   <code>"hello" + " " + "there"</code>.
+
   <code>text.value = "hello" + " " + "there";</code>
  
 
Within [[SHIP:Sail|Sail Scripts]] you can access the Unicode codepoints within a string, access portions of the string, and more using the [[SHIP:Sail:Functions#String_Functions|Sail String Functions]].
 
Within [[SHIP:Sail|Sail Scripts]] you can access the Unicode codepoints within a string, access portions of the string, and more using the [[SHIP:Sail:Functions#String_Functions|Sail String Functions]].

Revision as of 05:09, 19 April 2014

See Also

String

Stings in SHIP are a sequence of UTF8 characters terminated in an implicit end-of-string character.

Data Type Description
String A sequence of UTF8 characters terminated in an implicit end-of-string character.

Examples

String constants are written in Sail Scripts enclosed in double quotes ("), for example

 text.value = "hello";

and can be concatenated with the "+" operator, for example

 text.value = "hello" + " " + "there";

Within Sail Scripts you can access the Unicode codepoints within a string, access portions of the string, and more using the Sail String Functions.