Difference between revisions of "Core.DataTypes.SimpleDataType.String"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
{{DISPLAYTITLE:Data Type '''String'''}} | {{DISPLAYTITLE:Data Type '''String'''}} | ||
== Classification == | == Classification == | ||
− | {{ClassificationDataType | String | String value | [[Core.DataTypes.SimpleDataType|Simple Data Type]] | [[Core.DataTypes.SimpleDataType.SimpleType|SimpleType]]| DefaultValue=""| Literal=Yes | SpecifiedBy= | + | {{ClassificationDataType | String | String value | [[Core.DataTypes.SimpleDataType|Simple Data Type]] | [[Core.DataTypes.SimpleDataType.SimpleType|SimpleType]]| DefaultValue=""| Literal=Yes | SpecifiedBy={{OtxSpec2}}<!-- Go to the Template:OtxSpec2 in case of updating the info --> }} |
== Description == | == Description == |
Latest revision as of 06:55, 12 September 2019
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 = "";