dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: problem while replacing _ with &

  1. #1
    Join Date
    Nov 2009
    Posts
    128

    Question problem while replacing _ with &

    while formatting the string by using String.Format() with message "john & berry's",
    it displays like "john _berry's".

    & is replace by _

    [code]
    String.Format(StringHelper.GetFASMessagingValue("ListAddOptionConfirm"), Masking == null ? valueMember.Replace(@"&",@"\&") : new string(Masking.MaskedText).Replace(@"&",@"\&"), fieldName);
    [\code]

    please provide the solution

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,247

    Re: problem while replacing _ with &

    "john && berry's"

    The '&' character is used as the hot key. You escape it with a second '&' char.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)