C++ Split a String into 3 Lines of Equal Spacing
Budget: $10 – $30 AUD
Hi. I need some C++ code that will split a string into 3 equal length sections.
For example, let's say I have the string "Fantastic Rice Crackers Ched. Cheese 100g". I will need it split into 3 separate strings of equal length defined by a variable which I can adjust. In this example, let's say it's 15. This means that the string "Fantastic Rice" will be in string1, "Crackers Ched." will be in string2 and "Cheese 100g" will be in string3.
The code must also work so that it does not split words and hyphenate them. For example, the code cannot do "Fantastic Ri" for string1 and then "ce Crackers Ch" for string2. You must split it before space so long as it fits (in this example, 15 chars) in the string.
I do have a working example of some code I have already written, but it will only split the first line. I cannot get it to split the lines into 3 separate strings.
If you are up for the task, let me know and I will pay you to help me get it finished.
My code is attached for you to check.
Thanks.
For example, let's say I have the string "Fantastic Rice Crackers Ched. Cheese 100g". I will need it split into 3 separate strings of equal length defined by a variable which I can adjust. In this example, let's say it's 15. This means that the string "Fantastic Rice" will be in string1, "Crackers Ched." will be in string2 and "Cheese 100g" will be in string3.
The code must also work so that it does not split words and hyphenate them. For example, the code cannot do "Fantastic Ri" for string1 and then "ce Crackers Ch" for string2. You must split it before space so long as it fits (in this example, 15 chars) in the string.
I do have a working example of some code I have already written, but it will only split the first line. I cannot get it to split the lines into 3 separate strings.
If you are up for the task, let me know and I will pay you to help me get it finished.
My code is attached for you to check.
Thanks.