Difference between revisions of "Core.DataTypes.SimpleDataType.String"

From emotive
Jump to navigation Jump to search
Line 10: Line 10:
 
Integer=Returns the integer value of the string | IntegerSample=<tt>Integer i = ToInteger("123"); // Returns 123</tt> |
 
Integer=Returns the integer value of the string | IntegerSample=<tt>Integer i = ToInteger("123"); // Returns 123</tt> |
 
Float=Returns the float value of the string | FloatSample=<tt>Float f = ToFloat("123"); // Returns 123.0</tt> |
 
Float=Returns the float value of the string | FloatSample=<tt>Float f = ToFloat("123"); // Returns 123.0</tt> |
String=Returns the name of the enumeration value | StringSample=<tt>String s = ToString("123"); // Returns "123"</tt>|
+
String=Returns the copy of the value | StringSample=<tt>String s = ToString("123"); // Returns "123"</tt>|
 
ByteField=Returns the UTF-8 encoded value| ByteFieldSample=<tt>ByteField bf = ToByteField("123"); // Returns 313233</tt>
 
ByteField=Returns the UTF-8 encoded value| ByteFieldSample=<tt>ByteField bf = ToByteField("123"); // Returns 313233</tt>
 
}}
 
}}

Revision as of 09:25, 22 October 2018

Classification

Name String
Short Description String value
Class Simple Data Type
Base Data Type SimpleType
Default Value ""
Provide a Literal Yes
SpecifiedBy ISO 13209-2
Standard Compliant Yes

Description

The String data type identifies OTX in a sequence of zero or more characters.

Core Conversion

The following table shows the rules for conversion to another data type:

Conversion Result Sample
ToBoolean Returns true if the string value is "true", otherwise false Boolean b = ToBoolean("123"); // Returns false
ToInteger Returns the integer value of the string Integer i = ToInteger("123"); // Returns 123
ToFloat Returns the float value of the string Float f = ToFloat("123"); // Returns 123.0
ToString Returns the copy of the value String s = ToString("123"); // Returns "123"
ToByteField Returns the UTF-8 encoded value ByteField bf = ToByteField("123"); // Returns 313233

Sample

String StringVariable = "";