For example, I have a string:
"This is the ### example"
I would like to substring the ### out of the above string?
The number of Hash keys may vary, so I would like to find out and replace the ### pattern with, say, 001 for example.
Can anybody help?
If you want to capture multiple
#characters, then you’ll need regular expressions:If you want to remove the space too, you can use the regex
/#+\s|\s#+|#+/.