This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== String Type ====== A [[wp>String_(computer_science)|string]] is a sequence of arbitrary characters. ===== GUI Editor ===== [{{ :editors:string_editor.png?nolink |Graphical representation of the string editor}}] The string editor presents a text field where the string's characters can be typed directly. ===== EGO Script ===== ==== Legacy ==== Strings are sequences of any characters enclosed in double quotes (''"''): <code> "Amazon" "North" "This is an example of string" "landscape_123 " "x1_and_a_name" "string with \"double quotes\"" </code> A string can be any length, and can span multiple lines without any special line-break syntax: <code> "This is an example of a very long string with multiple lines. Note that line breaks do not need to be marked using any special syntax." </code> ==== Raw String Format (starting on Dinamica 5.0.1) ==== A raw string uses the following syntax: $"<delimiter>( raw_characters )<delimiter>" Where ''raw_characters'' is the string's content — any sequence of characters — and ''<delimiter>'' is any character that, together with the closing parenthesis '')'', does not appear inside ''raw_characters''. The delimiter can be omitted entirely if the closing parenthesis alone doesn't appear in the content. <code> $"(This is an example of String)" $"0(This is an example of String with the character ))0" $"1(This is an example of String with the sequence of characters )0)1" </code> A raw string can also be any length and span multiple lines, with no special line-break syntax needed: <code> $"(This is an example of a very long string with multiple lines. Note that line breaks do not need to be marked using any special syntax.)" </code> ===== Automatic Conversions ===== * **Converted from**: [[Boolean Value Type]], [[Code Type]], [[Index Or Name Type]], [[Integer Value Type]], [[Log Tag Type]], [[Name Type]], [[Non Negative Integer Value Type]], [[Positive Integer Value Type]], [[Real Value Type]], [[Folder Type]], [[Generic Filename Type]], [[Map Filename Type]], [[Table Filename Type]], [[Lookup Table Filename Type]], [[Weights Filename Type]], [[Kmz Filename Type]], [[Projection Type]], [[Elevation Graph Type]], and [[Table Value Type]] — the last can fail: it only succeeds if the Table Value Type actually holds a String. * **Converted to**: [[Code Type]], [[Date Type]], [[Index Or Name Type]], [[Name Type]], [[Folder Type]], [[Generic Filename Type]], [[Map Filename Type]], [[Table Filename Type]], [[Lookup Table Filename Type]], [[Weights Filename Type]], [[Kmz Filename Type]], [[Projection Type]], [[Table Value Type]], and [[Tuple Type]]. [[Real Value Type]] — can fail; the string must parse as a valid number (e.g. ''"test"'' fails, ''"3.14"'' succeeds). See [[type_system|Type System]] for the complete conversion reference across all types.