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: String Manipulation

Previous Thread :: Next Thread 
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
20 May 2016 06:02 PM
How would I go about making it remove spaces between words and only allowing one space?

text = 'HELLO
HI'

So people can't spam it down to other lines on a chat gui so that will be:

text = 'HELLO HI'

I'm not the best with string manipulation but I don't know enough at this present time as how to do this.


Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
20 May 2016 06:04 PM
Would I just get each word then add in my own spaces?


Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
20 May 2016 06:04 PM
text = [[Mind =
Blown]]


Private Drive - Residents Only
Report Abuse
cgjnm is not online. cgjnm
Joined: 22 Dec 2011
Total Posts: 2347
20 May 2016 06:05 PM
for i=1, StringHere:len() do
string.gsub(StringHere,' ',' ')
end
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
20 May 2016 06:09 PM
text = text:gsub('%s+',function(c) return c:sub(1,1) end);

I would have just done gsub('%s+',' ') but I wanted to preserve the first type of whitespace used.
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
20 May 2016 06:11 PM
Thanks eLunate.
How did that MC world generator game go?


Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
20 May 2016 06:15 PM
Hmmph, I haven't actually touched anything practical to do with Roblox in forever since Valkyrie.

I have a better infinite world generation thingy sandbox thing idea but I'll do it after Valkyrie because priorities.
Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
20 May 2016 06:17 PM
Ah ok. Now that there is universes you could make a pretty cool game with it.


Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
20 May 2016 06:19 PM
It would be good to get to write something with Valkyrie too.
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
20 May 2016 06:23 PM
I don't suppose you can provide a link to some Valkyrie documentation or the like please? I was quite interested but it turned to apathy when the 'daily' CC ended (Which to be fair went on for 6 days or something like that (IDK the numbering system was beyond me :P), making you the most dedicated amateur blogger of all time)


Private Drive - Residents Only
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
20 May 2016 06:28 PM
The thing about making daily stuff is that eventually I run out of stuff to write, somebody is bound to get pissy (Tynezz. Prick.), and I'm often quite busy.

I'd write the daily stuff again, because I enjoyed it, but it would have to have some better medium.


As for documentation, we have our own documentation project and format so like enjoy the current state of it https://github.com/CrescentCode/CrescentDocs
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