CASE_PRESERVE Function
Syntax
Preserved_String as C = CASE_PRESERVE(C string)
Arguments
- string
A character string.
Description
Returns a string + the case information.
Discussion
CASE_PRESERVE() returns the original Input_String with an appended hexadecimal code that indicates which characters of the Input_String are upper case. The appended code has sufficient bits to represent each character of the Input_String as 1 (upper case) or 0 (lower case). The most significant bit is to the left. The following illustration shows how the algorithm works. Note : CASE_PRESERVE() allows you to distinguish between upper and lower case versions of strings when using functions that are not case sensitive.
- Algorithm
- Result
- Input_String
Alpha Software
- Parsed into 4 character segments
Alph|a So|ftwa|re
- Binary representation of upper case characters
1000|0010|0000|0000
- Hexadecimal representation of upper case characters
8 |2 |0 |0
- Preserved_String Alpha Software
8200
Example
case_preserve("Edward") -> "Edward80" case_preserve("EDWArd") -> "EDWArdF0" case_preserve("Alpha Software") -> "Alpha Software8200"
See Also