let's say I have an image, with this formula:
blabla.com/bla/twofive.hash.png
The above can be represented as a string in JavaScript.
I'd like to know how to build an array that will break every special sign (such as "." and "/"), and will contain something like this:
var arr = ['blabla', 'com', 'bla', 'twofive', 'hash', 'png'];
so I can easily access any property of the array with a simple arr[number];
simply try
"blabla.com/bla/twofive.hash.png".split(/[./]/) //outputs ["blabla", "com", "bla", "twofive", "hash", "png"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With