Some questions about Strings
by beyond · in Torque Game Engine Advanced · 02/23/2011 (6:03 am) · 2 replies
Hello!
I have some questions about Strings:
1.) How to concatenate (add) two strings,
such as "strcat" function in C++?
2.) How to convert Value to String?
3.) How to convert String to Value?
I have some questions about Strings:
1.) How to concatenate (add) two strings,
such as "strcat" function in C++?
2.) How to convert Value to String?
3.) How to convert String to Value?
#2
02/23/2011 (12:09 pm)
Re 2) and 3): Everything is a string in TorqueScript. No conversions needed.
Torque Owner Chris Labombard
Premium Preferred
%bothstrings = "1" @ "a"; // concat result is "1a"
%bothstrings2 = "1" SPC "b"; // result is "1 b"
Compare strings: "str" $= "abc" ... returns false
%string = "1";
%string = %string @ "2";
(%string == 12) // returns true
(%string $= "12") // returns true
Hope that helped.