The function node uses JavaScript to work around the problem programmatically. For this you need basic knowledge of javascript, and a small amount of knowledge on how Node-RED works. Check the following links from the node-red docs: working with messages and using the function node.
Beyond that, take a look at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring
If you follow the concepts described in the working with messages and function node documentation, you should be able to work out the rest with the Mozilla Developer Network link. I'm not going to spoil the answer for you, but you should get it done with 5 lines of code at most. If you work this part out yourself, you can do most basics related to it without (much) help in the future