How can i remove data in datastore 2 in a string value?

Hello, i am spanish so sorry for my english.
I am using datastore2 and i want to delete data in string like this:

String value = “Dirt,Sand,Wood”

remove code? remove(Sand,)

Final string value = “Dirt,Wood”

How can i make that?

I tried this but dont worked lol: BuildingItemsData:Set(BuildingItemsData:Remove(HitBox.Parent.Parent.Name…“,”))

You can just overwrite the string by using the same function you used to add the data.

1 Like

Hello! You can use the Set function of Datastore2 to make the data nil.

1 Like

You can use string.gsub(StringVal, "Sand,").

This will return the string without “Sand,”.

1 Like