I have a string \XXXXXXDDDDDYYYY. I need to remove everything except XXXXXX. So I figured I use the replace function. The XXXXXX and DDDDDD and YYYYY does not stay the same size, it could be \XXXXXXXXXXXDDDDDDDDDDDDDDDDYY. I can remove the \ and . How do I remove everthing to the right of the first ?