I learned of Stringbuilder today and have been messing around with it as it might be the easiest or fastest method to do what I need to do.
I have a text file such as this:
Zach LCPL Schytt
Bill CPL John
Mark LCPL Simmons
...etc
I use the function below to read it from a listbox to a textbox.
StringBuilder^ sb = gcnew StringBuilder();
Convertor^ form2 = gcnew Convertor();
for (int i = 0; i < listBox1->Items->Count; i++){
String^ temp = listBox1->Items[i]->ToString();
sb->AppendFormat("{0}", temp)->AppendLine();
}
form2->textBox1->Text = sb->ToString();
form2->ShowDialog();
How do I go about making it look like the following instead? For each name,
dn: CN=Schytt LCPL Zach,DC=Sample,DC=Site
changetype: add
displayName: Schytt.Zach
I looked into insert, and stuff but don’t quite understand it.
Are you looking for something like this?