Questions tagged as 'string'

6
answers

Problem Scanner class in Java when entering multiple Strings as variables [duplicate]

I'm doing a little program for something more complex than this one, but the main problem I have is that I need to add at least two names but when I run it skips entering the first name. Better explain me in code, this is a small example of wh...
asked by 01.12.2017 / 00:49
2
answers

Search for different strings between two texts (JavaScript)

I need to find different words and small sentences of up to 5 words long (or could be customizable) from one text to another. The differences I want to keep in an array, so that only the words or phrases are saved without repeating (it is checke...
asked by 09.11.2017 / 11:23
2
answers

Remove special characters to a string in PHP?

How about? Veran I have a little problem with some strings that are full of a unicode character. My string is this: $variable = "c\u0000o\u0000d\u0000e"; Which has this unicode character: \ u0000 I would like to know how I can remove all...
asked by 09.04.2018 / 07:05
4
answers

How can I get today's date from a string and not the full value of it?

I have an application which I need to export several values. In one of them I have a string that returns a date with time included "2/8/2017 10:26:35 AM". What I need is to extract this string but only validating the day the code is executed....
asked by 08.02.2017 / 18:31
2
answers

Given a text and a letter indicate how many words appear that contain that letter

I was doing this exercise, however, when I run it, I do not see the number of words that contain that letter, only a zero appears, what am I wrong with? Thank you in advance texto=raw_input("ingrese un texto: ") letra=raw_input("ingrese una le...
asked by 13.02.2017 / 02:56
2
answers

Convert Array String to Array float

People have a challenge I have to convert arrayString to arrayFloat it's not how you usually do it array *date = [obj valueForKey:@"oficialTime"];// por ejemplo 10:10:02 float f = [date floatValue]; The problem here is that array is in Ns...
asked by 20.01.2017 / 13:12
4
answers

Checking a float through a String

I'm trying, without using try-catch (I'm not allowed in this case), to know if a String is susceptible to being parsed to double, but it does not accept values, such as 1.80. This is the method: private boolean alturaCorrecta() { boolean c...
asked by 28.11.2016 / 12:56
2
answers

Replace input string spaces

I have a method that receives a String, but I want to replace each space in the input string with a string consisting of three spaces. How could that start? With a replace?     
asked by 13.10.2016 / 00:06
1
answer

Extract words from a pattern in c #

I was wondering how I could extract the words out there, having a pattern. For example, given the following string, extract the word from inside: Palabra 1: "Raqueta" end: Palabra 2: "Motocicleta" end: It's just a simple example, the rea...
asked by 17.12.2018 / 01:52
1
answer

how do I assign words to numbers using random in python?

I would like to know how to have a str instead of a number (without using lists or random.randint) import random prob=random.randrange(1,5) 1 = pedro 2 = maria 3 = juan 4 = luis print (prob)    Traceback (most recent call last): File "pyt...
asked by 12.10.2018 / 06:22