Questions tagged as 'string'

1
answer

C # String.Contains () does not work, not even string search derivatives [closed]

I have a method in my code that looks up a person's name inside a string but always returns false. Even when the name exists inside the string. Which is totally inexplicable. I tried using Contains ex: linha.Contains(nome); I tried to us...
asked by 28.03.2017 / 21:15
3
answers

How to retrieve the first letter of a Swift array

I would like to know how to retrieve the first letter of an element from an array var wordEasy = ["uva", "manga"] var teste: String = wordEasy[0] I would like to retrieve only the letter u     
asked by 22.01.2016 / 18:07
2
answers

Error in comparing strings

I need to do a program where the program receives a phrase and then a letter, and then return how many times the letter appears in the sentence. So I did this: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStre...
asked by 07.09.2018 / 20:15
2
answers

When should I use a string object and a literal string?

Reading an article I find the following excerpt:    You can call any of the methods of the string object in a   string literal - JavaScript automatically converts the literal string   for a temporary string object, calls the method, then disc...
asked by 23.08.2018 / 02:34
1
answer

Replace is not working C #

I'm replacing one code with another in each line that the code is found. But the replace simply does not work, it goes through it and the line continues the same way. As you can see in the image below, if used within the immediate, it appears to...
asked by 10.01.2017 / 13:47
2
answers

Regex to get numbers between the second and third "/"

Let's say I have the following String / Product / 976935 / How would I do a regex to return only the numbers between the second and third bar? The number of numbers varies so it does not matter to return only the numbers     
asked by 12.03.2014 / 13:39
4
answers

How do I remove characters from a string up to a point? in PHP [duplicate]

I have the following code: $numeros = "142-22"; I just need "142" and I want to ignore the rest "-22". How do I do this? Expected output: $numeros = "142-22"; $num = "142"; Is there a function that I can use?     
asked by 15.08.2018 / 18:17
2
answers

Given the given String below, how do I define this division?

I have the following string:    "User data: JOAQUIM DE OIVEIRA, NASCIDO   IN 2010, FORMED IN: LAW, HOBBIE: FOOTBALL " How do I give a explode in this string only by validating the first sign of separation and dividing it in two? E...
asked by 08.12.2014 / 05:06
2
answers

How to handle an empty string?

I need to convert a string that I get from a text file and populate a person class where, each attribute of the class is separated by "," in the text file. The attributes are only: height, weight, age. In the text file they are as follows: 1.5...
asked by 03.09.2016 / 22:49
2
answers

I want to search by name of any function from a search field

Folks ... how can I make a system where input text gets a name of function .. then it searches its name internally with the name that is in string . kind ... In Html I do the following: <input type="text" id="seuInput...
asked by 15.05.2018 / 04:34