A Generic Character Editing Routine
July 12, 2016 Jon Paris
Note: The code accompanying this article is available for download here. Recently I was asked if I knew of a way to edit character strings. For example, take a character string representing a product code such as “AX12345Q” and edit it to produce “AX-123-45 Q”. My initial reaction was to reach for an edit word, but sadly they only work for numerics, for some strange reason. I set about building a subprocedure that offered the necessary flexibility in insert characters and also added a few “defenses” against mismatched parameters. Before describing the code, let’s look at the prototype for |