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. Javascript Replace

Javascript Replace

Scheduled Pinned Locked Moved ASP.NET
javascript
2 Posts 2 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.
  • M Offline
    M Offline
    mehrdadc48
    wrote on last edited by
    #1

    I want to replace a specified subString is a string by javascript. I don't know the exact substring part, just I know it starts with

    Best wishes

    R 1 Reply Last reply
    0
    • M mehrdadc48

      I want to replace a specified subString is a string by javascript. I don't know the exact substring part, just I know it starts with

      Best wishes

      R Offline
      R Offline
      Ray Wampler
      wrote on last edited by
      #2

      The string object in JavaScript has a replace method, so if you need to do more than a simple replace then we'd need some details. From http://www.w3schools.com/jsref/jsref_replace.asp[^]: Syntax stringObject.replace(findstring,newstring) Parameter Description findstring Required. Specifies a string value to find. To perform a global search add a 'g' flag to this parameter and to perform a case-insensitive search add an 'i' flag newstring Required. Specifies the string to replace the found value from findstring If you need to simulate the .startsWith function in JavaScript then here's an article that demonstrates how to do so using regular expressions: http://www.tek-tips.com/faqs.cfm?fid=6620[^] If you need to do something different then let us know. Regards,

      Ray Wampler www.RayWampler.com

      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