[String->Digit] returns the integer value of a specified character for a specified radix or -1 if the character is not defined for the specified radix. The character within the base string to be inspected is specified starting from 1 for the first character in the string.
A radix of 16 can be used to return the value of a hexadecimal digit (0-9 and A-F). A radix of 8 can be used to return the value of an octal digit (0-7). A radix of 2 can be used to return the value of a binary digit (0-1).
[Output: 'FFFFFF'->(Digit: 4,16)]
<?LassoScript
Variable: 'myString' = '00001000';
Variable: 'Result' = $myString->(Digit: 5, 2);
?gt;
Use the [String->Digit] tag. The following example returns the value of the fourth character in hexadecimal base 16. The result for C in base 16 is 12.
[Output: 'DEFC012'->(Digit: 4, 16)]
15
Tag Link | [String->Digit] | Category | String |
---|---|---|---|
Type | Member | Data Source | Any |
Support | Preferred | Version | 7.0 |
Output Type | Integer | Security | None |
Implementation | Sets | Lasso 7.0 |
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft