|
| 10 Jan 2017 07:43 AM |
text = "ABCDEF" text:sub(#text, 2, -2) I am trying to remove the first 2 letters of that text (AB) but it doesn't work. So how do I remove the first characters of a string? |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 10 Jan 2017 07:44 AM |
| ######################################################################## |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 10 Jan 2017 07:44 AM |
s= "Test string"
s = string.sub(str,3,#s) -- print(s)
>st string
|
|
|
| Report Abuse |
|
|
booing
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
|
| 10 Jan 2017 07:45 AM |
| ########################## |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 10 Jan 2017 07:46 AM |
Uhh let me condense that, first script of the morning sorry for bad
s = "Test string" print(string.sub(s,3,#s)) >st string
|
|
|
| Report Abuse |
|
|
|
| 10 Jan 2017 07:52 AM |
| Thank you Soybeen for the code example and for the fast response. I appreciate it. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 10 Jan 2017 07:53 AM |
Np haha, booing too, I'm sure he had the same thing but rocrap's censorship is amazing.
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 10 Jan 2017 07:53 AM |
| You actually don't need #### there, it defaults to that |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 10 Jan 2017 07:53 AM |
Nobody needs #### in there But roblox insists
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 10 Jan 2017 07:55 AM |
https://www.youtube.com/watch?v=p8IpleLaJg4
|
|
|
| Report Abuse |
|
|