for some reason someone has decided that trimming leading spaces is dangerous and had addeed a comment to that effect.
Main Topics
Browse All TopicsCan anybody give me a quick run down of what this does;
header[header.Count - 1] += oneLine.TrimStart(new char[] {' ' /* dangerous ! */, '\t'});
I'm trying to convert an implementation of domainKeys to vb.net and I have no idea what is going on here. I get that on eof the param array is a tab - but what is going on before that?
It's only the TrimStart call I don't understand. What is going on?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
TrimStart(new char[] {' ', '\t'});
Result is string instance without leading spaces and tabs in original string. This means, if oneLine string contains any number of spaces and tabs in any order in the beginning, they are removed from result. BTW, I don't see anything dangerous here. For example , if oneLine is " abc", this is executed as:
header[header.Count - 1] += "abc";
Business Accounts
Answer for Membership
by: ozymandiasPosted on 2006-11-06 at 07:31:00ID: 17881545
The string stored in the last position in the array called header is having another string (oneLine) appended to it but only after any leading spaces or tabs have been trimmed off it.
TrimStart() will remove whitespace characters from the start of a string.
TrimStart(char[]) will remove any characters in the char[].