locked
String manipulation??? RRS feed

  • Question

  • User-1104215994 posted

    Hi,

    I would like to manipulate a string. If I have a string as follows (if after first "/" there is "0") "21/06/2011" than I want to manipulate it to "21/6/2011" which means remove the zero after the first "/".

    How can I do it?

    Best Regards

    Thursday, June 2, 2011 8:54 AM

Answers

  • User-693248168 posted
    string text="21/06/2011"; text=text.Replace("/0","/");
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 2, 2011 9:00 AM

All replies

  • User-693248168 posted
    string text="21/06/2011"; text=text.Replace("/0","/");
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 2, 2011 9:00 AM
  • User-1500873099 posted

    U should use the Replace method of string to remove the perticular string pattern as suggested by Lateef045.

    Thanks.

    Thursday, June 2, 2011 9:06 AM
  • User-1104215994 posted

    Thanks so much

    Thursday, June 2, 2011 9:09 AM