Jump to content

string.upper problem


JeViCo

Recommended Posts

Posted

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

Posted (edited)
> 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

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
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

Posted

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

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
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 :\

Posted (edited)
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

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

Posted
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
Posted
2 hours ago, Juuve said:

Thank you! It works!

you are welcome

 

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

  • MTA Team
Posted

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

  • Like 1
Posted
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)

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