Char to int and back
No edit summary
No edit summary
Line 1: Line 1:
Convert a number to its corresponding character:
Convert a number to its corresponding character:
* Char.ConvertFromUtf32( 65 )  -- returns 'A'
 
<code>Char.ConvertFromUtf32( 65 )</code> -- returns 'A'
 
Convert a character to its corresponding Integer value:
Convert a character to its corresponding Integer value:
* Char.ConvertToUtf32('AB',0) -- returns 65
 
* Char.ConvertToUtf32('AB',1) -- returns 66
<code>Char.ConvertToUtf32('AB',0)</code> -- returns 65
 
<code>Char.ConvertToUtf32('AB',1)</code> -- returns 66
[[Category:OCL]]
[[Category:OCL]]
[[Category:Data types]]
[[Category:Data types]]

Revision as of 07:44, 1 September 2023

Convert a number to its corresponding character:

Char.ConvertFromUtf32( 65 ) -- returns 'A'

Convert a character to its corresponding Integer value:

Char.ConvertToUtf32('AB',0) -- returns 65

Char.ConvertToUtf32('AB',1) -- returns 66

This page was edited 96 days ago on 02/10/2024. What links here