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: Is string manipulation important?

Previous Thread :: Next Thread 
FoolHater is not online. FoolHater
Joined: 17 Jul 2008
Total Posts: 2141
24 Nov 2011 01:25 AM
I am almost done reading the String Manipulation section of the Function Dump Roblox Wiki article, but is string manipulation as important as coroutines or tables/metatables?

It strings have limited application in scripting "physics." Text/strings do not seem to need a knowledge of complex functions to be manipulated.
Report Abuse
FoolHater is not online. FoolHater
Joined: 17 Jul 2008
Total Posts: 2141
24 Nov 2011 08:01 AM
Okay, for example, string manipulation deals with uncommon functions like string.reverse(s), which returns a string that is the string "s" reversed:

print(string.reverse ("!moM ,olleH"))

Will result in:
Hello, Mom!

Does it not seems limited in the application of scripting?
Report Abuse
shadowsoulforever is not online. shadowsoulforever
Joined: 28 Sep 2011
Total Posts: 635
24 Nov 2011 08:15 AM
You don't need to use but if you are comparing strings the safe would upper them both or lower them both and compare. Like this.

function compare(string1,string2)
if string1:lower()==string2:lower() then
return true
else
return false
end
end

compare("ASD",string.reverse("DSA"))
Report Abuse
shadowsoulforever is not online. shadowsoulforever
Joined: 28 Sep 2011
Total Posts: 635
24 Nov 2011 08:17 AM
Opps add

print(compare("asd",string.reverse("DSA")))
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
24 Nov 2011 08:18 AM
local Format = "Current number of players: %d, Tick(): %d"
local Msg = Instance.new("Hint",Workspace)

while Msg.Parent == Workspace do
Msg.Text = Format:format(#game:GetService("Players"):GetChildren(), tick())
wait()
end

~+[CROOKITY BANDED SNAKES]+~
Report Abuse
FoolHater is not online. FoolHater
Joined: 17 Jul 2008
Total Posts: 2141
24 Nov 2011 08:21 AM
So basically strings are limited to comparison and printing messages.

Don't get me wrong, I read the Wiki: string manipulation, patterns, and captures. I just want to know if they are important to my scripts.

By the way, what does tick() do?
Report Abuse
shadowsoulforever is not online. shadowsoulforever
Joined: 28 Sep 2011
Total Posts: 635
24 Nov 2011 08:23 AM
No they can be used for tables, hold values but they are still useful.

table={}
Report Abuse
popinman322 is not online. popinman322
Joined: 04 Mar 2009
Total Posts: 5184
24 Nov 2011 08:28 AM
local function usefulfunction()
print("Doing something useful...")
end

local DumpString = string.dump(usefulfunction)
loadstring(DumpString)()

Instance.new("Model",Workspace)

Workspace.Model[string.reverse("evomeR")](Workspace["Model"])

~+[CROOKITY BANDED SNAKES]+~
Report Abuse
PuzzleCrazy is not online. PuzzleCrazy
Joined: 01 Feb 2010
Total Posts: 1245
24 Nov 2011 08:57 AM
I'll put it this way, once you get into using 'loadstring()' they can become very useful. I've used single strings for databases. The reason a string can be so powerful is because it has no limitations:

str = "1"
print(tonumber(str)+1)


str = "true"

str2 = loadstring("return " .. str)

if str2 then
str2 = str2()
if str2 == true then
print("See how much you can do with strings?")
end
end


Report Abuse
FoolHater is not online. FoolHater
Joined: 17 Jul 2008
Total Posts: 2141
24 Nov 2011 09:13 AM
How was the string used as a database in your example, Puzzle?
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