monday.com Interview Question

I was asked to implement a string manipulation function