Jump to content

String commands


Alienhead
 Share

Go to solution Solved by Josh,

Recommended Posts

( LUA ) 

I haven't got most of the string commands to work yet.

Even pulled some of the demos straight out of the docs.

 

local string = "Hello, how are you today?"
print(string:GetSize())

 

Trim seems to work, and lower/upper.. but for the others no luck

Always the commands I'm in dire need of too..  lol

Lucky the base lua string commands seem to be ok. 

string.len(a)  for example.

 

 

 

  • Upvote 1
Link to comment
Share on other sites

  • Solution

The Ultra string classes are not exposed in Lua. Ultra uses wide strings, which do not work well with Lua strings. However, all command interfaces between C++ and Lua that pass strings convert UTF8 (Lua) to wide strings (C++) and back.

I have added the string methods as functions that can be used like this:

s = "test"
s = Right(s, 1)
s = Trim(s)

I also added Len(s), which is like Ultra's GetSize() method for the string class.

This will be available in the next build.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...