User Tools

Site Tools


changing_20the_20case_20of_20a_20string

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
changing_20the_20case_20of_20a_20string [2018/03/31 13:19] – external edit 127.0.0.1changing_20the_20case_20of_20a_20string [2024/01/05 00:22] (current) – external edit 127.0.0.1
Line 4: Line 4:
 ==== Changing the whole string ==== ==== Changing the whole string ====
 \\  To change the case of the string **My$** to upper case use code similar to the following:\\  \\  To change the case of the string **My$** to upper case use code similar to the following:\\ 
 +<code bb4w>
         SYS "CharUpperBuff", !^My$, LEN(My$)         SYS "CharUpperBuff", !^My$, LEN(My$)
 +</code>
 \\  To change the case of the string **My$** to lower case use code similar to the following:\\  \\  To change the case of the string **My$** to lower case use code similar to the following:\\ 
 +<code bb4w>
         SYS "CharLowerBuff", !^My$, LEN(My$)         SYS "CharLowerBuff", !^My$, LEN(My$)
 +</code>
 \\  \\ 
 ==== Changing a portion of a string ==== ==== Changing a portion of a string ====
 \\  To change characters at the start of the string to upper case use code similar to the following:\\  \\  To change characters at the start of the string to upper case use code similar to the following:\\ 
 +<code bb4w>
         SYS "CharUpperBuff", !^My$, Num%         SYS "CharUpperBuff", !^My$, Num%
 +</code>
 Here **My$** is the string you want to alter and **Num%** is the number of characters to change. The value of **Num%** must be less than or equal to the length of the string.\\ \\  To change characters at the end of the string to lower case use code similar to the following:\\  Here **My$** is the string you want to alter and **Num%** is the number of characters to change. The value of **Num%** must be less than or equal to the length of the string.\\ \\  To change characters at the end of the string to lower case use code similar to the following:\\ 
 +<code bb4w>
         SYS "CharLowerBuff", !^My$ + LEN(My$) - Num%, Num%         SYS "CharLowerBuff", !^My$ + LEN(My$) - Num%, Num%
 +</code>
 Here **My$** is the string you want to alter and **Num%** is the number of characters to change. The value of **Num%** must be less than or equal to the length of the string.\\ \\  To change the case of characters in the middle of the string to upper case use code similar to the following:\\  Here **My$** is the string you want to alter and **Num%** is the number of characters to change. The value of **Num%** must be less than or equal to the length of the string.\\ \\  To change the case of characters in the middle of the string to upper case use code similar to the following:\\ 
 +<code bb4w>
         SYS "CharUpperBuff", !^My$ + Pos%, Num%         SYS "CharUpperBuff", !^My$ + Pos%, Num%
 +</code>
 Here **My$** is the string you want to alter, **Pos%** is the position of the first character in the string to alter and **Num%** is the number of characters to change. The sum of **Num%** and **Pos%** must be less than or equal to the length of the string. Here **My$** is the string you want to alter, **Pos%** is the position of the first character in the string to alter and **Num%** is the number of characters to change. The sum of **Num%** and **Pos%** must be less than or equal to the length of the string.
changing_20the_20case_20of_20a_20string.1522502348.txt.gz · Last modified: 2024/01/05 00:18 (external edit)