Jump to content

utf8.match


Recommended Posts

if not utf8.match(edit,"^%u") then
-- the first letter not capitalized
end

How to make a check that all letters are small?

I have some code that checks if the first letter is capitalized. But I still don't understand how to use it back. At least some examples are needed. Where can I read more about this?

 

Link to comment

Hey,

Well you can use string.match and check whether there are any uppercase letters.
If it returns nill then all the letters are lowercase and everything is good.

if string.match(text, '%u') == nil then
	-- all chars are lowercase
else
	-- an uppercase letter is found
end

I hope I understood correct what you want to do.

Edited by SpecT
  • Like 1
Link to comment
8 hours ago, SpecT said:

Hey,

Well you can use string.match and check whether there are any uppercase letters.
If it returns nill then all the letters are lowercase and everything is good.


if string.match(text, '%u') == nil then
	-- all chars are lowercase
else
	-- an uppercase letter is found
end

I hope I understood correct what you want to do.

This is what I need, thanks for the help.

  • Like 1
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...