Tekken Posted May 29, 2015 Posted May 29, 2015 How do I check if a text have upper or lowercase letters?
Walid Posted May 29, 2015 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.
Tekken Posted May 29, 2015 Author 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 ?
Walid Posted May 29, 2015 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.
Tekken Posted May 29, 2015 Author 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
Walid Posted May 29, 2015 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()
xXMADEXx Posted May 29, 2015 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 ) );
Walid Posted May 29, 2015 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?"
xXMADEXx Posted May 29, 2015 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.
Walid Posted May 29, 2015 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
xXMADEXx Posted May 29, 2015 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.
Walid Posted May 29, 2015 Posted May 29, 2015 Ah yes, I didn't see that. It's fine, people make mistakes. yes i know , have a nice day
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