I'm generating the user interface labels from database columns in one of my applications. While doing this I came across an issue. The same column names as in my database table is being shown in the UI which I wish to change.
I have sample data like this:
ProductionIssueID
MAXSerialNo
ProductID
Item
I wish to format them like this:
Production Issue ID
MAX Serial No
Product ID
Item
The logic is:
1. When a capital alphabet succeeds the small alphabet then a space has to be inserted as shown in Production Issue ID
2. When a small alphabet succeeds a capital one then space has to be inserted as given in MAX Serial No and Product ID
3. If there is Only one capital alphabet nothing has to be done as in Item
4. No space is required between a similar pair of capital/small alphabets.
Please help me to achieve this. The examples are more descriptive.
Thanks in advance for your valuable time and efforts.