|
| 10 Apr 2013 10:32 AM |
| How would I make it so it takes a Value, lets say "JusticeLym" and takes out "L"s then returns it to a new value "Justiceym". Any ideas? Something like c/ admin. |
|
|
| Report Abuse |
|
|
|
| 10 Apr 2013 10:37 AM |
value = "JusticeLym" result = "" for i = 1, #string do if string.sub(value, i, i) ~= "L" then result = result..string.sub(value, i, i) end end
This sets 'result' to be the initial string without any Ls. |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Apr 2013 11:14 AM |
| Is there a way to add it into a word? |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Apr 2013 11:16 AM |
If you know the location of the newly added bit, yes you can. Also, use newString = oldString:gsub("L", "") to get rid of L's. |
|
|
| Report Abuse |
|
|