Questions tagged as 'string'

1
answer

Is there any specific type for non-String passwords in .Net?

I see very commonly the use of string s to store passwords in the program memory, not only in .Net, but in all programming languages I have ever used. At first, I do not see a problem in this. But as I know the .Net ecosystem is HUGE,...
asked by 26.02.2014 / 16:08
1
answer

Encrypt a phrase / word by reversing and changing the vowels, by the following vowels

I was given an exercise in which I have to write a program that reads a word in the range [1-20] and encrypts this word using the steps: Reverse the word where you have a vowel, replace with the next vowel And display the word encrypted...
asked by 30.05.2016 / 00:58
5
answers

Add character in the middle of a string

Problem How to add character in the middle of a javascript string? For example: var string = "aacc"; // eu quero colocar as letras bb no meio da aa e cc I want string to have this value aabbcc How can I do this?     
asked by 23.04.2014 / 19:20
4
answers

Removing a specific space in a string

I'm having trouble implementing replace in String in Android Studio. I need to remove some white space in String . Real examples: 8 hrs 2 mins 1 day 2 mins I need the text to look like this: 8hrs 2mins...
asked by 16.12.2015 / 12:21
2
answers

How to convert text to number?

How do I convert a text that I know is an integer coming from externally? It would be something like ToInt() or something like that.     
asked by 20.02.2017 / 13:57
2
answers

How do I repeat a string in Python?

The question is simple: How do I repeat a string in Python? I'm used to PHP. When I want to repeat a string in PHP, I do so: var $str = 'StackOverflow'; str_repeat($str, 5); // Imprime: StackOverflowStackOverflowStackOverflowStac...
asked by 13.08.2015 / 13:56
3
answers

How to shuffle characters from a String in Java at random?

I am developing a password generator program. Here you can set the percentage of numbers, letters and special characters you want to have in your password, as well as the size of your password. Later I concatenate the numbers, letters and symbol...
asked by 12.11.2015 / 20:43
1
answer

Move string and replace a specific PHP character

I wanted to replace, in a string, all occurrences of the & character with a e (or remove it). The character may be in the middle of a word or appear multiple times in the same string. Example:    Original value: John went...
asked by 26.05.2014 / 10:09
3
answers

Error for unknown cause: "SyntaxError: invalid range in character class"

Situation: I have a page that contains a <iframe> of another, on this other page, I have a simple HTML element input : <input type="text" required="" pattern="[a-Z]{2,35}" tabindex="6" name="edtCidade" id="edtCidade"&g...
asked by 14.02.2014 / 16:40
4
answers

Select string randomly

I need a way to randomly create a string between some options. Let's say I have the strings "A" "B" and "C", would it be possible for Java to choose randomly?     
asked by 10.11.2014 / 19:17