MCPcopy
hub / github.com/google/earthengine-api / replace

Method replace

python/ee/ee_string.py:174–194  ·  view source on GitHub ↗

Returns a string with some or all matches of a pattern replaced. Args: regex: The regular expression to match. replacement: The string that replaces the matched substring. flags: A string specifying a combination of regular expression flags, specifically one or more of

(
      self,
      regex: _arg_types.String,
      replacement: _arg_types.String,
      flags: _arg_types.String | None = None,
  )

Source from the content-addressed store, hash-verified

172 )
173
174 def replace(
175 self,
176 regex: _arg_types.String,
177 replacement: _arg_types.String,
178 flags: _arg_types.String | None = None,
179 ) -> String:
180 """Returns a string with some or all matches of a pattern replaced.
181
182 Args:
183 regex: The regular expression to match.
184 replacement: The string that replaces the matched substring.
185 flags: A string specifying a combination of regular expression flags,
186 specifically one or more of: 'g' (global match) or 'i' (ignore case).
187
188 Returns:
189 A string with the replacements.
190 """
191
192 return apifunction.ApiFunction.call_(
193 f'{self.name()}.replace', self, regex, replacement, flags
194 )
195
196 def rindex(self, pattern: _arg_types.String) -> ee_number.Number:
197 """Searches a string for the last occurrence of a substring.

Callers

nothing calls this directly

Calls 2

nameMethod · 0.95
call_Method · 0.80

Tested by

no test coverage detected