|
| 23 May 2014 09:25 AM |
I'm trying to run a method that subtracts characters from the end of a string. For example, if I were to subtract 5 characters,
"I like pie verily so" becomes "I like pie veri"
Is there any method to doing this? |
|
|
| Report Abuse |
|
|
|
| 23 May 2014 09:26 AM |
Use string.sub http://wiki.roblox.com/index.php?title=String_manipulation#string.sub
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::] |
|
|
| Report Abuse |
|
|
|
| 23 May 2014 10:18 AM |
function subString(str, amount) if str:len() < amount then return "" end return str:sub(1,str:len()-amount) end
subString("Hello", 3) >>He |
|
|
| Report Abuse |
|
|