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 » Scripting Helpers
Home Search
 

Re: Trim whitespace from start and end a string

Previous Thread :: Next Thread 
Merely is not online. Merely
Joined: 07 Dec 2010
Total Posts: 17266
18 Nov 2011 04:02 PM
For example:

s = [[ sdjflksjfdl ]]

What pattern do I use such that

s:gsub(pattern, "") --> sdjflksjfdl
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
18 Nov 2011 04:04 PM
White-space meaning... space? If so, just use this:

    local String = [==[ No white space shall be saved ]==]
    
    String = String:gsub(" ", "")
    String = String:gsub("\t", "")
Report Abuse
Merely is not online. Merely
Joined: 07 Dec 2010
Total Posts: 17266
18 Nov 2011 04:06 PM
The %s class is perfectly fine for my purposes. However, I don't want to remove whitespace from the interior of the string, only the outside.
Report Abuse
Merely is not online. Merely
Joined: 07 Dec 2010
Total Posts: 17266
18 Nov 2011 04:14 PM
Never mind if you have this problem just search it up.
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
18 Nov 2011 04:24 PM
i never get string patterns :O
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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