Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I use string manipulation to replace the hyphens with spaces?

	local num = 1923919
	local FaceID = "http://rproxy.pw/Orange-Sparkle-Time-Fedora-item?id=215751161"
	local sub = string.sub(FaceID, 18)
	local rev = string.reverse(sub)
	local ot  = string.sub(rev, string.len(num) + 12)	

This script prints Orange-Sparkle-Time-Fedora like its supposed to. But what I need to do is replace the hyphens with spaces, but how would I do that?

2 answers

✓ Accepted answer

String.gsub replaces any letter/number with another letter/number

so it'd b lik dis cuti patooti

FaceID = string.gsub(FaceID,"-"," ")

There's the string.gsub function, which replaces things with other things.

ot = ot:gsub("-", " ") --Replace hyphen with space

This discussion is preserved as it was. New answers, comments, and votes are closed.