Ad

Ad

  • NA
  • 9
  • 0

manipulating a string

Oct 16 2004 8:33 PM
Hi, I was wondering if anyone knows how I could change a few things in a string. Say something returns a string like "a table" or "a chair". How can I remove the a and capatalize the t or c so it comes out like this: "Table" or "Chair". I've tried to remove the first to bits of the string by doing str.Remove(0, 2). After that, i've tried using ToCharArray() and doing this: char[] stra = str.ToCharArray(); then stra[0].ToUpper(); Although this doesn't work. After i've made it look like Table or Chair I need to return a string not char[] or char. I'm am very new to C# and this is my first bit of string manipulation, sorry if i've gone way off the track here. Thanks for any help. gordy

Answers (7)