Questions tagged [startswith]

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.

412 questions
-1
votes
2 answers

Getting index position of string in List C#

Trying to get the index position of a string in a List but it keeps returning zero(0) as the index integer variable. Any ideas what is wrong? I have tried changing to public int and so on. public int GetLangPos(string cultureCode) { …
user5537890
-1
votes
3 answers

Python startswith() for loop and if statement

I want to run a for loop in an array list and print anything out that has the word 'monkey' in it. I wrote the following code below but it is giving me an error. I'm not too sure what i am doing wrong. Any help would be great, thank you. a=…
Infinity
  • 75
  • 1
  • 1
  • 6
-1
votes
2 answers

Is there method startswith in xojo like in Java or Vb.Net?

I try to learn xojo. Is there any method Startswith in xojo just like in Java and Vb.net? If there is, how should I implement it? Thank you.
-1
votes
1 answer

Get MethodInfo of String.TrimStart with reflection?

I gonna get MethodInfo of String.TrimStart() The following code returns null. typeof(string).GetMethod("TrimStart", new Type[ ] {}); and the following code returns {System.String TrimStart(Char[])} typeof(string).GetMethod("TrimStart",…
Mohammad Dayyan
  • 21,578
  • 41
  • 164
  • 232
-1
votes
1 answer

Difference between equals() and startsWith() in java

Im practicing recursion for my own amusement using the codingBat exercises. Im doing this exercise: Given a string, compute recursively the number of times lowercase "hi" appears in the string, however do not count "hi" that have an 'x' immedately…
user2737948
  • 329
  • 2
  • 10
  • 25
-1
votes
1 answer

C# StartsWith - Multiple results

I need your help! I have wrote a function which save the "ID" from a Textfile to a Combobox. Thats working, now i want to read the "ID" and under the id the values in the textfile when i select the combobox. Its like "ID" = L1 220313 100 Values =…
Coder64
  • 11
  • 3
-1
votes
5 answers

Ends-with and Starts-with in if statements: Python 3

I am new to python and I have to create a program that validates a DNA sequence. (background on DNA sequences really quick) in order to be valid: • The number of characters is divisible by 3 • The first 3 characters are ATG • The last 3…
user3230395
  • 11
  • 1
  • 1
  • 2
-2
votes
4 answers

How do I get the beginning of a string in Python?

So... I tried to get what my string starts with and I tried to see if I can get what my string starts with, with the startswith function. But as I'm trying to use startswith function it just returning True or False. This is how I tried: str1 = "sdf…
Negai
  • 13
  • 5
-2
votes
2 answers

How does one recognize and/or replace a custom-formatted string value?

I'm retrieving a JSON-conform data-structure from a live chat API, but when a chat message shows an image the message value shows the url in its own format, embedded in between %%%[ and ]%%%. The below object gives a preview on what was just…
vic73
  • 3
  • 2
-2
votes
2 answers

Filter values in rows contain specific string for further calculation

This is my dataframe: In [2]: fruits = pd.DataFrame({"apple_price": [100, 100, 200, 500, 100, 600, 200], ...: "cherry_price": [2, 3, 1, 0, 2, 1, 1], ...: "banana_price": [2, 4, 5, 2, 3, 5, 3], …
RMNB
  • 13
  • 2
-2
votes
3 answers

startswith() function not working in while loop but works in for loop? python

not working while-loop i=0 l1=["rohan","sachin","sam","raj"] while i
-2
votes
3 answers

Make a StartsWith function in C getting "Segmentation fault", What's wrong?

I'm trying to make an startswith function which if i had a string consists of "Hello I am kira" will split into the first word "Hello" Only and I really tried my best to get it to this form #include unsigned char *startswith(unsigned char…
anon
-2
votes
1 answer

Startswith with a range of number instead an unit

ip = a list of ips ipf = list(filter(lambda x: x if not x.startswith(str(range(257,311))) else None, ip)) Is is possible to do something like this? I tested it and it doesn't work. I'd like to delete all ips from "ip" list that start with 256. 257.…
CatchJoul
  • 87
  • 2
  • 8
-2
votes
3 answers

Extracting lines from a text in python

I am trying to extract the lines that start with this entries and create a new file. This is what I have: def ReadFileContents(): file_content = open('Testing.pdb') all_file_content = file_content.readlines() list3 = [] for line in…
pedro
  • 9
  • 1
  • 4
-2
votes
2 answers

Java startsWith doesn't seem to work

I need some help with this problem - Java's startsWith() method doesn't seem to be working. Does someone know why is this happening? The method: public boolean check(File f) { boolean ans = (f.getName().startsWith(this.pre)); …
Re'em
  • 1,869
  • 1
  • 22
  • 28
1 2 3
27
28