Tekken Posted May 29, 2015 Share Posted May 29, 2015 How do I check if a text have upper or lowercase letters? Link to comment
Walid Posted May 29, 2015 Share Posted May 29, 2015 How do I check if a text have upper or lowercase letters? You can use sth like this string.match(Text here, patterns) patterns %l --- all lowercase letters. %u --- all uppercase letters. Link to comment
Tekken Posted May 29, 2015 Author Share Posted May 29, 2015 How do I check if a text have upper or lowercase letters? You can use sth like this string.match(Text here, patterns) patterns %l --- all lowercase letters. %u --- all uppercase letters. and if i want to remove it ? Link to comment
Walid Posted May 29, 2015 Share Posted May 29, 2015 and if i want to remove it ? You want to remove the Whole string or just the (lowercase or uppercase) letters. Link to comment
Tekken Posted May 29, 2015 Author Share Posted May 29, 2015 and if i want to remove it ? You want to remove the Whole string or just the (lowercase or uppercase) letters. I use string.find(text, "WoRdS") and I want to remove that word iven if have lower or uppercase letters Link to comment
Walid Posted May 29, 2015 Share Posted May 29, 2015 I use string.find(text, "WoRdS") and I want to remove that word iven if have lower or uppercase letters Use string.gsub() Link to comment
xXMADEXx Posted May 29, 2015 Share Posted May 29, 2015 To make upper or lowercase, you can use the upper or lower string methods: local t = "This IS my TeXt!"; -- Lower case (Same thing in a different format) print ( t:lower( ) ); print ( string.lower ( t ) ); -- Uppercase (Same thing in a different format) print ( t:upper( ) ); print ( string.upper ( t ) ); Link to comment
Walid Posted May 29, 2015 Share Posted May 29, 2015 To make upper or lowercase, you can use the upper or lower string methods: local t = "This IS my TeXt!"; -- Lower case (Same thing in a different format) print ( t:lower( ) ); print ( string.lower ( t ) ); -- Uppercase (Same thing in a different format) print ( t:upper( ) ); print ( string.upper ( t ) ); :3 i think you need to read the question because as i can see he is asking about "How he can check if a text have upper or lowercase letters?" Link to comment
xXMADEXx Posted May 29, 2015 Share Posted May 29, 2015 To make upper or lowercase, you can use the upper or lower string methods: local t = "This IS my TeXt!"; -- Lower case (Same thing in a different format) print ( t:lower( ) ); print ( string.lower ( t ) ); -- Uppercase (Same thing in a different format) print ( t:upper( ) ); print ( string.upper ( t ) ); :3 i think you need to read the question because as i can see he is asking about "How he can check if a text have upper or lowercase letters?" and if i want to remove it ? You want to remove the Whole string or just the (lowercase or uppercase) letters. I use string.find(text, "WoRdS") and I want to remove that word iven if have lower or uppercase letters I was answering this question. Link to comment
Walid Posted May 29, 2015 Share Posted May 29, 2015 I was answering this question. Also , Wrong answer he is asking about how he can remove the word. simply he can use string.gsub string.gsub(Text,"the Word you want to remove"," ") -- Empty replaceString Example : Text = "You gave him a wrong answer" NewText = string.gsub(Text,"wrong","") -- Result : You gave him a answer Link to comment
xXMADEXx Posted May 29, 2015 Share Posted May 29, 2015 I was answering this question. Also , Wrong answer he is asking about how he can remove the word. simply he can use string.gsub string.gsub(Text,"the Word you want to remove"," ") -- Empty replaceString Example : Text = "You gave him a wrong answer" NewText = string.gsub(Text,"wrong","") -- Result : You gave him a answer Ah yes, I didn't see that. It's fine, people make mistakes. Link to comment
Walid Posted May 29, 2015 Share Posted May 29, 2015 Ah yes, I didn't see that. It's fine, people make mistakes. yes i know , have a nice day Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now