
09-29-2001, 03:00 AM
|
Registered User
|
 |
Join Date: Mar 2001
Posts: 825
|
|
Changing case in strings
~AlphaFlame~
How would one go about changing the case of letters in a string? Say you have a string "this.letters" being set letter by letter... and you want certain letters to be capitalized. Script example:
if (playerchats){
for (this.i=0;this.i<strlen(#c);this.i++){
if (!strequals(#e(this.i+3,1,#c),h)){
setstring letters,#s(letters) #e(this.i+3,1,#c);
} else {
setstring letters,#s(letters) capitlization thing here;
}
}
Now, lets say I wanted all the H's to be capitalized. How would I go about doing that where the blue text is? My idea was to use the new ascii command, and add/subtract the correct value from lowercase to uppercase, but then I'd need to know how to check the ascii of that particular letter...
Hopefully you people can understand that :o |
__________________
If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
|
|
|