generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Remove first 2 characters of a string

Previous Thread :: Next Thread 
RoyalBoyMc is not online. RoyalBoyMc
Joined: 11 Apr 2012
Total Posts: 170
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 is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
10 Jan 2017 07:44 AM
########################################################################
Report Abuse
Soybeen is not online. 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 is not online. booing
Joined: 04 May 2009
Total Posts: 6594
10 Jan 2017 07:45 AM
##########################
Report Abuse
Soybeen is not online. 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
RoyalBoyMc is not online. RoyalBoyMc
Joined: 11 Apr 2012
Total Posts: 170
10 Jan 2017 07:52 AM
Thank you Soybeen for the code example and for the fast response. I appreciate it.
Report Abuse
Soybeen is not online. 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 is not online. 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 is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
10 Jan 2017 07:53 AM
Nobody needs #### in there
But roblox insists


Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Jan 2017 07:54 AM
#
st
r
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
10 Jan 2017 07:55 AM
https://www.youtube.com/watch?v=p8IpleLaJg4


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image