Delphi: Convert set of Char to string WITH ranges

In an application I’m working on, I need to convert a set of characters to a string, but I want it to be short, so I want to keep the ranges intact. Now, there may be a better way of doing this, but I had little luck finding a solution online, so I wrote this piece of code:

If you input [‘a’..’z’, ‘A’..’Z’, ‘0’..’9′, ‘_’, ‘ ‘, ‘.’], it will print out the string: [‘ ‘, ‘.’, ‘0’..’9′, ‘A’..’Z’, ‘_’, ‘a’..’z’]

In case anyone knows a better way of doing this, let me know in the comments.

Read More