Unfortuantely, the lack of operators for strings make this pretty impossible. There are unfortunately no commands for selecting individual characters in a string, nor determining the length of a string. With these, it would be possible, and I could have it done for you in a few minutes. Without them, I'm afraid not. You could try starting with the characters forming an array of 1-letter strings, and that would also work, but it's not possible to convert a string into this form either.
How do we get bohemia interactive to release a patch introducing the commands we want; I can think of so many I would like to see. Examples: a command to retrieve *all* the objects in the game at an instant, a command to retrieve all the objects in a certain area of the game, string manipulation commands like we need here, a command to reference weapons as objects instead of just by tag, commands to access fundamental properties of objects, like armour values/physical dimensions/rate of fire/etc. Is this worth a thread on the official forums? I can't see why it take long for a couple of programmers to create some commands in OPFscript to do this.