I'm using an array to store the names of lots of different sprites. The user is able to change the sprites using the file chooser and then the file name amends the array as a new description of the sprite.
I've got this working well although I cannot figure out how to remove the file extension from the string when the sprite is changed.
At the moment I have:
File Choooser > On Changed > Array > Set Value at 0 to FileChooser.FileNameAt(0)
If anyone could advise how i can get the filename added to the Array without the .png or .jpeg extension I would really appreciate it!
You could try it with 'tokenat'.
tokenat(src, index, separator)
Return the Nth token from src, splitting the string by separator. For example, tokenat("apples|oranges|bananas", 1, "|") returns oranges.
File Choooser > On Changed > Array > Set Value at 0 to tokenat(FileChooser.FileNameAt(0),0,".")
Develop games in your browser. Powerful, performant & highly capable.
That did the trick! Thank you ever so much :)