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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Strings

Previous Thread :: Next Thread 
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
10 Apr 2017 02:38 PM
Is there a way to edit strings in code with string patterns?
Report Abuse
Inductive is not online. Inductive
Joined: 28 May 2012
Total Posts: 6480
10 Apr 2017 02:40 PM
Google search "Roblox strings" real quick.
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
10 Apr 2017 02:40 PM
LoadString()
Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
10 Apr 2017 02:45 PM
Can you elaborate on those answers?
Report Abuse
devHoodie is online. devHoodie
Joined: 04 Nov 2008
Total Posts: 30332
10 Apr 2017 02:46 PM
http://wiki.roblox.com/index.php?title=Global_namespace/String_manipulation


r+://487783315r+://467523707r+://215869124
Report Abuse
chexyalani is online. chexyalani
Joined: 26 Mar 2017
Total Posts: 694
10 Apr 2017 02:47 PM
@Prestigious

Loadstring turns a string into a lua function and then run it.
Report Abuse
Mister_Manakin is not online. Mister_Manakin
Joined: 16 Sep 2009
Total Posts: 1935
10 Apr 2017 02:50 PM
msg = "print(3)"
f = loadstring(msg)

f() --> 3
Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
10 Apr 2017 02:51 PM
The only thing I found on that wiki page that had anything to do with string patterns is match, gmatch, and gsub. None of the three have to do with directly editing the strings.
Report Abuse
Intended_Pun is not online. Intended_Pun
Joined: 10 Aug 2016
Total Posts: 4384
10 Apr 2017 02:51 PM
"msg = "print(3)" f = loadstring(msg) ### ### ## #### proves nothing.
Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
10 Apr 2017 03:00 PM
For example, could you do something like this:

local string = "1a"

string:Reformat("%l%d")

print(string)

output:

>a1
Report Abuse
QuantumNexsus is not online. QuantumNexsus
Joined: 09 Nov 2014
Total Posts: 2451
10 Apr 2017 03:03 PM
When was Reformat a thing.


#code print(string.rep("Lit",5))
Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
10 Apr 2017 03:06 PM
It's not, I was just giving a general idea of what I'm looking for
Report Abuse
chexyalani is online. chexyalani
Joined: 26 Mar 2017
Total Posts: 694
10 Apr 2017 03:06 PM
Reformat doesn't exist in lua.
Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
10 Apr 2017 03:08 PM
^^
Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
10 Apr 2017 04:00 PM
Bump
Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
11 Apr 2017 02:45 PM
Bump2
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
11 Apr 2017 02:47 PM
Yes, there's a way... how is this even a question? Assign the variable to a the return value of a string function.


Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
11 Apr 2017 02:51 PM
@Unsub How would you use a string pattern?
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
11 Apr 2017 02:53 PM
In what situation?


Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
11 Apr 2017 02:55 PM
Something like this

string:Reformat("%d%l")

(I know reformat isn't a function, it's just to give you an idea)
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
11 Apr 2017 02:56 PM
What are you trying to do?


Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
11 Apr 2017 02:58 PM
Change the string using string patterns. string = #### #################### The match function would return a2. string = #### ####################### Is there a function that would return 2a?
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
11 Apr 2017 03:01 PM
string = string:reverse()


Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
11 Apr 2017 03:02 PM
Hash 1: "a2" string:match("%l%d").
Report Abuse
NexanianStudios is online. NexanianStudios
Joined: 16 Jul 2016
Total Posts: 1109
11 Apr 2017 03:03 PM
Using string patterns
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