replace string at index

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oll3i
    Contributor
    • Mar 2007
    • 679

    replace string at index

    Is it possible to replace a string indicating start and end positions ?
    thank You
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Originally posted by oll3i
    Is it possible to replace a string indicating start and end positions ?
    thank You
    can you plz explain....

    Comment

    • oll3i
      Contributor
      • Mar 2007
      • 679

      #3
      I want to replace some text in a string indicating the start and end position and I want to remove some pattern from a string indicating position

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Originally posted by oll3i
        I want to replace some text in a string indicating the start and end position and I want to remove some pattern from a string indicating position
        Sorry! We can't seem to find the resource you're looking for

        Comment

        • mrhoo
          Contributor
          • Jun 2006
          • 428

          #5
          str=str.slice(s tartindex,endin dex)

          negative numbers in the second argument count from the end of the string

          escape any slashes in the rx
          (It takes 2 idelimeters in a string construction)

          var reg = new RegExp("<b>"+tx t+"<\\/b>");

          Comment

          • oll3i
            Contributor
            • Mar 2007
            • 679

            #6
            thank You
            now i need the reg exp to be "<b>" some text "</b>"
            var reg = new RegExp("<b>"+tx t+"</b>"); throws an error
            txt is a passed string

            Comment

            • oll3i
              Contributor
              • Mar 2007
              • 679

              #7
              it didnt work cos test method is case sensitive :) now works
              thank You

              Comment

              Working...