Difference between revisions of "Core.DataTypes.SimpleDataType.String"
Jump to navigation
Jump to search
m (Hb moved page Core.OtxDataTypes.SimpleDataType.String to Core.DataTypes.SimpleDataType.String: #3153) |
|||
(9 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:Data Type '''String'''}} | {{DISPLAYTITLE:Data Type '''String'''}} | ||
== Classification == | == Classification == | ||
− | {{ClassificationDataType | String | String value | [[Simple Data Type]] | | + | {{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 == | ||
The '''String''' data type identifies OTX in a sequence of zero or more characters. | The '''String''' data type identifies OTX in a sequence of zero or more characters. | ||
+ | |||
+ | {{ConversionTable | | ||
+ | Boolean=Returns true if the string value is "true", otherwise false| BooleanSample=<tt>Boolean b = ToBoolean("123"); // Returns false</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> | | ||
+ | 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> | ||
+ | }} | ||
+ | |||
+ | ==Sample== | ||
+ | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
+ | String StringVariable = ""; | ||
+ | </syntaxhighlight> |
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 = "";