Is there a way to print the only first part of a HttpService:GenerateGUID()
?
For example, I generated {5ae76737-b926-43e8-8048-9e466e4894ad}
, and I only want to print the first section 5ae76737
.
Is there a way to print the only first part of a HttpService:GenerateGUID()
?
For example, I generated {5ae76737-b926-43e8-8048-9e466e4894ad}
, and I only want to print the first section 5ae76737
.
print(
game:GetService("HttpService"):GenerateGUID(false):split("-")[1]
)
Pass false
into :GenerateGUID()
. It’s the parameter that controls whether brackets are included.
Oh I didn’t even see that mb, thank you for the help
You could use string library:
local firstString = string.split(YOUR_GUID, '-')[1]
-- output if we print now: "{0hso398"
Then,
local cleanedString = string.gsub(firstString , '{', '')
print(cleanedString)
-- output: "0hso398"
That should work. Remember always to see the documentation for further info about the string library.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.