Sign in to follow this  
JeViCo

string.upper problem

Recommended Posts

Hello everyone! I have a little problem:

mystring = "somE teXt"
mystring = mystring:lower()
outputChatBox(mystring)

i get in chat somE teXt so string.lower function doesn't work for me. Help me please O.o

Share this post


Link to post
> mystring = "somE teXt" mystring = mystring:lower() print(mystring)
some text

Your code is fine, the chat should display everything lowercase.

You've probably made a mistake in your code.

Edited by DNL291

Share this post


Link to post
2 hours ago, DNL291 said:

> mystring = "somE teXt" mystring = mystring:lower() print(mystring)
some text

Your code is fine, the chat should display everything lowercase.

You've probably made a mistake in your code.

my part of code:

addCommandHandler("check",function(cmd, stre, stre2, value)
		if (stre and stre2 and value) then
			stre = stre:lower()
			print("stre = "..stre)
			stre2 = stre2:upper()
			print("stre2 = "..stre2)
		end
end)

it doesn't work here

Share this post


Link to post

Note: You cannot use "check", "list" or "test" as a command name.

Share this post


Link to post
11 hours ago, DNL291 said:

Note: You cannot use "check", "list" or "test" as a command name.

Ok, but i replaced it with detail command and keep getting the same resul :\

Share this post


Link to post
16 hours ago, Juuve said:

Ok, but i replaced it with detail command and keep getting the same resul :\

try to use another formula 

addCommandHandler("mycmd",function(cmd, stre, stre2, value)
		if (stre and stre2 and value) then
			print("stre = "..(string.lower(stre)))
			print("stre2 = "..(string.upper(stre2)))
		end
end)

is it work?

Edited by Master_MTA
  • Thanks 1

Share this post


Link to post
8 hours ago, Master_MTA said:

try to use another formula 


addCommandHandler("mycmd",function(cmd, stre, stre2, value)
		if (stre and stre2 and value) then
			print("stre = "..(string.lower(stre)))
			print("stre2 = "..(string.upper(stre2)))
		end
end)

is it work?

Thank you! It works! I can't understand why it didn't work before. Maybe i wrote a formula wrong

  • Like 1

Share this post


Link to post

Well it looks like you didn't enable OOP in the meta.xml, using <oop>true</oop>

  • Like 1

Share this post


Link to post
1 hour ago, LopSided_ said:

Well it looks like you didn't enable OOP in the meta.xml, using <oop>true</oop>

yeah, i guess the problem was here)

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.