bigframes.pandas.api.typing.StringMethods.startswith#

StringMethods.startswith(pat: str | tuple[str, ...]) T[source]#

Test if the start of each string element matches a pattern.

Examples:

>>> import bigframes.pandas as bpd
>>> s = bpd.Series(['bat', 'Bear', 'caT', pd.NA])
>>> s
0     bat
1    Bear
2     caT
3    <NA>
dtype: string
>>> s.str.startswith('b')
0     True
1    False
2    False
3     <NA>
dtype: boolean
>>> s.str.startswith(('b', 'B'))
0     True
1     True
2    False
3     <NA>
dtype: boolean
Parameters:

pat (str, tuple[str, ...]) – Character sequence or tuple of strings. Regular expressions are not accepted.

Returns:

A Series of booleans indicating whether the given

pattern matches the start of each string element.

Return type:

bigframes.series.Series