Jump to content

Upper and lowercase letters


Tekken

Recommended Posts

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

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

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
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
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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...