PtokaX forum

Development Section => Your Developing Problems => Topic started by: MANOS on 14 December, 2004, 03:55:27

Title: CAPITAL <-> LOWERCASE
Post by: MANOS on 14 December, 2004, 03:55:27
Hi,

In order to finish one script of mine, I need to know how I can make the program to treat capital and lowercase letters as the same. For example: WoRd == word == WorD etc

Please help me if you can.
Thank you.
Title:
Post by: VidFamne on 14 December, 2004, 09:01:06
with; strlower(s) or strupper(s)
look >>HERE<< (http://www.lua.org/manual/4.0/manual.html#6.2)
Title: YOU SAVED ME
Post by: MANOS on 14 December, 2004, 12:48:47
Thank you very much VidFamne.  :)
But still I can't understand the usage of strupper(s,n). I had tried to use this, but nothing happened. Could u give me an example with this command?
Thanks again. :)
Title:
Post by: Herodes on 14 December, 2004, 15:21:30
there isnt any strupper(string, number) in lua ... the documentation shows that there is a strrep(string, number)..

 strrep (s, n)
Returns a string that is the concatenation of n copies of the string s.

Example :

strrep("ho ", 3).." !!! Merry Christmas!"

returns

"ho ho ho  !!! Merry Chistmas!"
Title:
Post by: VidFamne on 14 December, 2004, 17:13:28
And;  strupper("Ho,hO,ho").." !!! Merry Christmas!"
returns
HO,HO,HO !!! Merry Christmas!
while; strlower("Ho,hO,ho").." !!! Merry Christmas!"
returns
ho,ho,ho !!! Merry Christmas!
Title:
Post by: MANOS on 15 December, 2004, 01:45:17
Thank you both. :) Now I learn 3 more commands in lua. :-P
Also I had realized that I was reading the wrong manual. :-P I thought that PtokaX version 0.3.3.0 was supporting lua 5. But obviously I was wrong. Thanks again. :)