Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-943

provide putAt(Range) on StringBuffer

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-2
    • Fix Version/s: 1.0-JSR-3
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      def buf = new StringBuffer('0123')
      buf[1..2] = 'xx'
      assert '0xx3' == buf.toString() , 'replace with String'
      buf = new StringBuffer('0123')
      buf[1..2] = 99
      assert '0993' == buf.toString() , 'replace with obj.toString()'
      buf = new StringBuffer('0123')
      buf[0..<0] = 'xx'
      assert 'xx0123' == buf.toString(), 'border case left'
      buf = new StringBuffer('0123')
      buf[4..4] = 'xx'
      println buf.toString()
      assert '0123xx' == buf.toString(), 'border case right'
      // more weird Ranges already tested in ListTest

        Attachments

          Activity

            People

            • Assignee:
              codevise Dierk König
              Reporter:
              codevise Dierk König
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: