I need to make a long string, about 360 characters, with different values that I am sending to a service. I know the positions for each section and I need to be able to insert values and blanks until I get to the next position.
The following is just an example that I started; per say I need to start in position 0 and the next value needs to go in position 5(abc). So far I’ve been able to concatenate like this: “1234abc”, but what I need is “1234[space]abc[space][space]” Thanks for your help.
//sbTrialSpaces
private void TrialSpaces()
{
string str1 = "1234";
string str2 = "abc";
string finalStr;//Has to be 10 positions
//like this "1234 abc "
}
This will make five spaces for each of the values, even if they are less than five characters wide. The “-” means that the values will be left-justified.