Relates to the task of finding a subset of data at the beginning of a set of data. Usually refers to strings but could be other types of data. Please accompany with a language specific tag.
Questions tagged [startswith]
335 questions
-3
votes
2 answers
How to create a 'startswith' function inside a class
I'm working in List and storing my data in class and again using new list to differentiate between receive data.
I'm using startswith function to check for data inside a string. But i also want to call startswith function inside loop with string is…
Talha Shafique
- 73
- 14
-3
votes
1 answer
regex match for startswith
Given a random length of filepath, how to regex for something in the middle:
name = 'path/to/../../foo/file.py'
something like this:
In [2]: name.startswith('.*/foo/')
Out[2]: False
A. Archer
- 65
- 2
- 9
-3
votes
2 answers
Check if string starts with zero or more parentheses and "A(" after it using startswith()
I want to detect if a string starts with any of these "A(", "((A(", "(((A(", ... As you can see the number of starting parentheses could be zero or more. My problem is that startswith() in java does not get regex as input. So, how is it possible to…
user3150474
- 39
- 4
-4
votes
2 answers
Find text starts with "Column" and ends with any number (e.g. "100") and nothing between the two, using C#
I want to find texts (using C#), in a string, that starts with the word "Column" and ends any number (for example "100").
In short, I want to find:
Column1
Column100
Column1000
But not to find:
Column_1
_Column1
Column1$
I can't find a way to do…
MuratO
- 15
- 5
-10
votes
1 answer
Startswith Error in Python
I am trying to read through a file and skip certain lines. I'm using str.startswith() to do this:
for lines in analysis:
if line.startswith("#"):
continue
Then, I have further cases that analyzes all subsequent lines.
However, I get…
user2545406
- 15
- 4