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: Since I'm absolutely horrible at string manipulation...

Previous Thread :: Next Thread 
rayoma is not online. rayoma
Joined: 13 Nov 2009
Total Posts: 1911
08 Aug 2011 07:08 PM
If when I'm making my own string pattern, how would I make it search for multiple symbols? Like if you just do


print(("werere==wrewrewr"):find("=="))

it'll say

7 8

but how would I do this with a set?
Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
08 Aug 2011 07:10 PM
Explain 'Set'?
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
08 Aug 2011 07:12 PM
-_- not again.

@phoenix
if you don't know anything about string patterns then you won't be any help with my question.
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
08 Aug 2011 07:18 PM
Yet if you must know,

pattern="[qwerty]"


print(("qwertyvillage"):gsub(pattern,"A"))

Output :
AAAAAAvillagA 7
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
08 Aug 2011 07:21 PM
"Explain 'Set'?"

"-_- not again."


xDDDDDDDDDDD I lol'd. And as always, I won't help at all.
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
08 Aug 2011 07:23 PM
I'll give you your hat back :O
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
08 Aug 2011 07:44 PM
Sets are done with [], look at the qwerty example, any of those 6 letters will be replaced with A.
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
08 Aug 2011 07:47 PM
@electric

do you have any idea how to do it?
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
08 Aug 2011 08:07 PM
Yeah, I know string manipulation, one of the first 'advanced' things I learnt and the one I like the most still. :P
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
08 Aug 2011 08:10 PM
I meant the original question, I could tell you knew string manipulation stuff with your first post.
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
08 Aug 2011 08:16 PM
pattern = "[qwerty]"
msg = "hello there my good friend, how are you?"
a = 1
msg:gsub(pattern, function(b) a = msg:find(b, a) print(a) end)
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
08 Aug 2011 08:22 PM
thanks, but it's still giving me 7,7 where I'm tryin to get 7,8. :/
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
08 Aug 2011 08:29 PM
Like what I'm trying to do is get the following symbols

==
!=
>
>=
<
<=

out of strings so that I can easily compare them without a huge conditional statement, so I'm trying to use patterns.
Report Abuse
ElectricAxel is not online. ElectricAxel
Joined: 15 May 2009
Total Posts: 16239
08 Aug 2011 08:42 PM
text = ""
text:gsub("(%p)(%p-)", function(a, b) if a == "=" or a == "!" or a == ">" or a == "<" and not b then
print()
elseif a == "=" or a == "!" or a == ">" or a == "<" and b == "=" then
print()
end

And then you have to add what I added with the string.find x_x
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
08 Aug 2011 08:48 PM
Thanks alot. :D
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