Mike Zahm Posted August 25 Posted August 25 Hello, I can't find any information in the wiki about Editi masks. Does this exist in LSL? Example: I want to format a two-digit HOUR using the (string) function. For now, I use this type of writing to edit an integer HOUR string HH = (string)HOUR; if (llStringLength(HH) == 1) HH = “0” + HH; It would still be simpler with an edit mask ...
Quistess Alpha Posted August 25 Posted August 25 why not just string HH = (string)(HOUR/10) + (string)(HOUR%10); 3
Mike Zahm Posted August 26 Author Posted August 26 (edited) yes, that's good, I hadn't thought of that, thank you very much Edited August 26 by Mike Zahm 1
elleevelyn Posted August 27 Posted August 27 (edited) another way to do this string HH = llGetSubString("0" + (string)HOUR, -2, -1); // get the two rightmost chars Edited August 27 by elleevelyn 1
Mike Zahm Posted August 27 Author Posted August 27 (edited) Bravo I admit that this is a very nice demonstration of the use of negative indexes in a string. Edited August 27 by Mike Zahm
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now