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

Previous Thread :: Next Thread 
player is not online. player
Joined: 04 Nov 2006
Total Posts: 1053
17 Jul 2012 08:42 PM
I am resorting to pushing tons of data inside a single string.

It includes a string, a CFrame Value, a Parent Directory, Another string, and another CFrame.

I wanted to divide them within the string through the "*" symbol.

For example:

"Ello*0,0,0,0,0,0,0,0,0*workspace.Player.Head*Blarg*0,0,0,0,0,0,0,0,0"

Is there a way I can easily search the string until it hits a "*" and then collects the according string?
Report Abuse
PrEDaToR6686 is not online. PrEDaToR6686
Joined: 06 Apr 2012
Total Posts: 1029
17 Jul 2012 08:43 PM
idk
Report Abuse
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
17 Jul 2012 08:47 PM
Umm..

string="Cake*Cake2"
local string2=string:gmatch(".+*"):gsub("*","")
print(string2)

Not sure.

--TehChikenHater ლ(ಠ_ಠლ)
Report Abuse
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
17 Jul 2012 08:48 PM
There's alway's the tabular way. .-.

names={}
table.insert(names,"Something")
print(table.concat(names," "))

:3

--TehChikenHater ლ(ಠ_ಠლ)
Report Abuse
player is not online. player
Joined: 04 Nov 2006
Total Posts: 1053
17 Jul 2012 10:11 PM
I'm looking at the string manipulation wiki, but it is not helping me much.
I'm messing around with "string.find" but it isn't working like I planned.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
17 Jul 2012 10:20 PM
I think you might want to use string.match...

† KMXD †
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
17 Jul 2012 10:42 PM
S = "Ello*0,0,0,0,0,0,0,0,0*workspace.Player.Head*Blarg*0,0,0,0,0,0,0,0,0"
for i in string.gmatch(S, '[^%*]+') do
print(i)
end

>Ello
>0,0,0,0,0,0,0,0,0
>workspace.Player.Head
>Blarg
>0,0,0,0,0,0,0,0,0
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
17 Jul 2012 10:44 PM
String.find

local mes = "Hi this is a string.find example" print(string.find(mess,"."))

print(string.find(mes,"g."))

Output
>19, 20


String.find returns then numbers of the characters position of the first and last character of the string you wanted to find. Sorry if it is a bit confusing :3
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
17 Jul 2012 10:45 PM
Whoops did the print() two times :3
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