MCPcopy Index your code
hub / github.com/javascriptdata/danfojs / endsWith

Method endsWith

src/danfojs-base/core/strings.ts:292–310  ·  view source on GitHub ↗
(str = "", options?: { inplace?: boolean })

Source from the content-addressed store, hash-verified

290 */
291 endsWith(str: string, options?: { inplace?: boolean }): Series
292 endsWith(str = "", options?: { inplace?: boolean }): Series | void {
293 const { inplace } = { inplace: false, ...options }
294 const newArr: Array<boolean | number> = [];
295 this.values.map((val) => {
296 if (utils.isEmpty(val)) {
297 newArr.push(NaN);
298 } else {
299 newArr.push(`${val}`.endsWith(str));
300 }
301 });
302 if (inplace) {
303 this.series.$setValues(newArr as ArrayType1D)
304 this.series.print()
305 } else {
306 const sf = this.series.copy()
307 sf.$setValues(newArr as ArrayType1D)
308 return sf;
309 }
310 }
311
312 /**
313 * Checks whether a string contains the specified string/characters

Callers 8

strings.test.jsFile · 0.80
$toJSONFunction · 0.80
$toCSVFunction · 0.80
$toExcelFunction · 0.80
$toJSONFunction · 0.80
$toCSVFunction · 0.80
$toExcelFunction · 0.80
strings.test.tsFile · 0.80

Calls 5

isEmptyMethod · 0.80
$setValuesMethod · 0.80
mapMethod · 0.65
printMethod · 0.65
copyMethod · 0.65

Tested by

no test coverage detected