swaggerbox
10-17-2016, 04:56 AM
How to reformat a string that contains numeric values and place them before the textual values. Example provided below:
From:
"I have the following parts: watermelon peel 18-19, sweet almond 15-20, brown sugar 3-5, Chinese yam 20-22, radix glycyrrhizae 1.6-2, water caltrop shell 1.6-2.1, begonia birchleaf 1.2-2.1, potato 200-230"
To:
"I have the following parts: 18-19 pts. wt. watermelon peel, 15-20 pts. wt. sweet almond, 3-5 pts. wt. brown sugar, 20-22 pts. wt. Chinese yam, 1.6-2 pts. wt. radix glycyrrhizae, 1.6-2.1 pts. wt. water caltrop shell, 1.2-2.1 pts. wt. begonia birchleaf, 200-230 pts. wt. potato."
From:
"I have the following parts: watermelon peel 18-19, sweet almond 15-20, brown sugar 3-5, Chinese yam 20-22, radix glycyrrhizae 1.6-2, water caltrop shell 1.6-2.1, begonia birchleaf 1.2-2.1, potato 200-230"
To:
"I have the following parts: 18-19 pts. wt. watermelon peel, 15-20 pts. wt. sweet almond, 3-5 pts. wt. brown sugar, 20-22 pts. wt. Chinese yam, 1.6-2 pts. wt. radix glycyrrhizae, 1.6-2.1 pts. wt. water caltrop shell, 1.2-2.1 pts. wt. begonia birchleaf, 200-230 pts. wt. potato."