MCPcopy Create free account
hub / github.com/cogentcore/core / RowsByStringTry

Method RowsByStringTry

tensor/table/indexview.go:512–519  ·  view source on GitHub ↗

RowsByStringTry returns the list of *our indexes* whose row in the table has given string value in given column name (de-reference our indexes to get actual row). if contains, only checks if row contains string; if ignoreCase, ignores case. returns error message for invalid column name. Use named ar

(column string, str string, contains, ignoreCase bool)

Source from the content-addressed store, hash-verified

510// returns error message for invalid column name.
511// Use named args for greater clarity.
512func (ix *IndexView) RowsByStringTry(column string, str string, contains, ignoreCase bool) ([]int, error) {
513 dt := ix.Table
514 ci, err := dt.ColumnIndexTry(column)
515 if err != nil {
516 return nil, err
517 }
518 return ix.RowsByStringIndex(ci, str, contains, ignoreCase), nil
519}
520
521// Len returns the length of the index list
522func (ix *IndexView) Len() int {

Callers

nothing calls this directly

Calls 2

RowsByStringIndexMethod · 0.95
ColumnIndexTryMethod · 0.80

Tested by

no test coverage detected