Jump to content

Help with strings


Tw1xee

Recommended Posts

I have one question about LUA strings. In sa-mp client scripters can use tab params in strings with '/t', but i haven't this in LUA. How i can do this?

string.gsub(stringVar, '/t', '     ') 

my example isn't good, pls ask me your ideas about this.

Sorry for my bad English! My native language isn't English, so I have some mistakes, but I think you'll understand me)

Link to comment

i want make this (example):

local tempStr = "Firstname: \t\t" .. anyoneStringWithFirstname 
tempStr = tempStr .. "\nLastname: \t\t" .. anyoneStringWithLastname 
--prints: Firstname:       testname1 
--        LastName:       testname2 (newline) 

but i get one space char in string result (without horizon tabs):

Firstname: testname1 
Lastname: testname2 

Link to comment
check my tut here : LUA Strings

You don't have the horizontal tab In your tutorial

You mean the result become like that,it look like a one space between them?

Firstname: testname1 
Lastname: testname2 

If yes, you have nothing to change with them, F Capital is not like L Capital so here's where the different exist

Example to see it more clear,

Firstname: testname1 
Firstname: testname1 

Lastname: testname2 
Lastname: testname2 

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