Need an example. you want to change "WethePeopleoftheUnitedStates" to this: "We the People of the United States" ? If the text is in a file then you will have to completly rewrite the file. First open the original file for reading, then another file for writing. In a loop read a line, modify it in memory as desired, then write the modified string to the output file.
Problem: how do you know where to add the spaces and new lines ?
If this is schoolwork then your teacher should tell you how to do it. Otherwise, its nearly impossible for a program to check a string and add spaces where necessary to make it understandable to a human reader. You need to get more information from whoever gave you the requirements for the program.
that should be fairly simple. First find the comma and back up one character. That is where you insert the space. Add another space immediately after the command, and a line feed one character beyone that. Do it with two string arrays -- the first is the original string and the second is the altered string.
I would write it for you, but I don't want to spoil all your fun :)
You can't use the original string array to insert the spaces for a couple reasons
the array may not be large enough to hold the additional characters.
the array may be a literal and stored in read-only memory, any attempt to change it would probably crash the program.
So to overcome those problems create another string array that is large enough to hold all the characters in the first plus the additional characters you want to add. Making the second array too large is ok, but too small can be a disaster waiting to happen.