I hope that fixed it for you. But even if it does, I think this is probably not the right or best way to do it. It feels pointless. But I can't be sure.
You have asked what is called an "X-Y" question. You want do to X and you think you need to do Y to achieve it, but you can't make Y work. So you ask the forum how to fix Y.
But if you ask the forum how to achieve X, there might be an easy way that does not require Y to be done at all!
You could pass a pointer to the actual char array in the String, but there is no way to actually pass a String to a pointer, a pointer just points to something else, it cannot contain any actual data itself. You also need to be careful setting a pointer to anything having to do with a String, because Strings tend to get dynamically moved around in memory if you start manipulating them.
You can store the String in a char array, then set a pointer to point to that char array, but then why not just store the text in a char array to begin with.
but I need to change this data, programmatically within my code, I get this data from the serial port in the form of strings, hence my need to pass from strings to pointers