Difference between revisions of "Core.DataTypes.SimpleDataType.String"
Jump to navigation
Jump to search
Line 13: | Line 13: | ||
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> | ||
}} | }} | ||
+ | |||
+ | ==Sample== | ||
+ | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
+ | String StringVariable = ""; | ||
+ | </syntaxhighlight> |
Revision as of 08:46, 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 name of the enumeration value | String s = ToString("123"); // Returns "123" |
ToByteField | Returns the UTF-8 encoded value. | ByteField bf = ToByteField("123"); // Returns 313233 |
Sample
String StringVariable = "";