Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to replace special caracters like " ' & ....

How to replace special caracters like " ' & ....

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aymen hassine
    wrote on last edited by
    #1

    I have an xls file to create but it's name is automatically generated, so it may include some special caracters like ' " , or even é à ... so i must replace these caracters by a simple underscore before giving the name of the file. so how to do that ? how to fix the list of these caracters ? could i use their ASCII codes just to not have to enmumerates all of them ! thanks in advance

    M I 2 Replies Last reply
    0
    • A aymen hassine

      I have an xls file to create but it's name is automatically generated, so it may include some special caracters like ' " , or even é à ... so i must replace these caracters by a simple underscore before giving the name of the file. so how to do that ? how to fix the list of these caracters ? could i use their ASCII codes just to not have to enmumerates all of them ! thanks in advance

      M Offline
      M Offline
      munklefish
      wrote on last edited by
      #2

      Aymen, im not sure what exactly you are trying to do, as your explanation is not very clear. However, it may be possible to do what your after by either: 1) replacing letters / characters with their ASCII equivalent or 2) Use regular expressions, Splitter and Replace to find the offending characters, then replace them with something else. This combination is very effective in replacing characters in a string, and can be done in about 3 lines of code. Search for all 3 on google, and you'll get lots of examples. If however ive totally misunderstood you, then post again with a clearer explanation. Munklefish

      1 Reply Last reply
      0
      • A aymen hassine

        I have an xls file to create but it's name is automatically generated, so it may include some special caracters like ' " , or even é à ... so i must replace these caracters by a simple underscore before giving the name of the file. so how to do that ? how to fix the list of these caracters ? could i use their ASCII codes just to not have to enmumerates all of them ! thanks in advance

        I Offline
        I Offline
        Ista
        wrote on last edited by
        #3

        myfilename.Replace(); 1 line of code equals many bugs. So don't write any!!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups