Method: Browser::DOM::CharacterData#replace

Defined in:
opal/browser/dom/character_data.rb

#replace(string, offset = 0, count = `#@native.length`) ⇒ self

Replace data in the node.

Parameters:

  • string (String)

    the data to replace with

  • offset (Integer) (defaults to: 0)

    the offset to start at

  • count (Integer) (defaults to: `#@native.length`)

    how much data to replace

Returns:

  • (self)


57
58
59
60
61
# File 'opal/browser/dom/character_data.rb', line 57

def replace(string, offset = 0, count = `#@native.length`)
  `#@native.replaceData(offset, count, string)`

  self
end