Given:
String course = String.Format
(
"{0}-{2} {1} {3} {4} {5}",
c.course_ID.ToString().Trim(),
c.course_Name.Trim().PadRight(20),
c.Section_Num.ToString().Trim(),
c.Start_Time.ToString().Trim(),
c.Quarter.Trim(),
c.Year.ToString().Trim())
);
I have this output:
"150-2 FF Test 11:59:00 Winter 2016"
"314-1 Test Course 11:59:00 Winter 2016"
However, when these are then added to a combobox, the second line is always two spaces longer than the previous line.
combo_box.Items.add(course);
"150-2 FF Test 11:59:00 Winter 2016"
"314-1 Test Course 11:59:00 Winter 2016"
Any suggestions on how to fix this?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.