string Questions
2
Solved
On stackoverflow there are a lot of answers about how to keep only alphabetic characters from a string, the most common accepted is the famous regex '[^a-zA-Z]'. But this answer is totally wrong be...
Claritaclarity asked 27/6, 2017 at 11:37
6
Solved
When I ran size and length on a string, they returned the same value.
"akash".size # => 5
"akash".length # => 5
What is the difference between these two methods?
8
How do I delete non-UTF8 characters from a ruby string? I have a string that has for example "xC2" in it. I want to remove that char from the string so that it becomes a valid UTF8.
This:...
14
Solved
I have been given the two strings "str1" and "str2" and I need to join them into a single string. The result should be something like this: "String1, String 2". The "str1" and "str2" variables howe...
Iodide asked 2/1, 2014 at 11:29
14
Solved
I am learning basic C++, and right now I have gotten a string from a user and I want to check if they typed the entire file name (including .txt) or not. I have the string, but how can I check if t...
19
I have one string say "Aniruddh" and I want to reverse it using lambdas and streams in Java 8. How can I do it?
Rattler asked 27/11, 2017 at 5:58
9
So I've been learning Python for some months now and was wondering how I would go about writing a function that will count the number of times a word occurs in a sentence. I would appreciate if som...
2
Solved
I have string "6A" how can I convert into hex value 6A?
Please help me with solution in C
I tried
char c[2]="6A"
char *p;
int x = atoi(c);//atoi is deprecated
int y = strtod(c,&p);//Retur...
3
Solved
when I compile the following files, I've got the error:
ECArgs.h:36:3: error: ‘string’ does not name a type
ECArgs.h:36: ECString value(char c);
Could somebody give me any hints for the error?
...
Palsy asked 4/3, 2013 at 4:6
2
Solved
I have a strings with pattern, something like this:
(X,1,1,3),(X,1,1,3),(X,@2,@2,@2,@2,@2,(Y,1))
And I need to extract from this One big array, reverse order, and generate new string:
(X,(Y,1),@2,...
Bernadinebernadotte asked 3/6 at 19:2
5
Solved
We all know that +, Number() and parseInt() can convert string to integer.
But in my case I have very weird result.
I need to convert string '6145390195186705543' to number.
let str = '61453901951...
Whoa asked 23/8, 2018 at 11:8
9
Solved
I'm reading a file into python 2.4 that's structured like this:
field1: 7
field2: "Hello, world!"
field3: 6.2
The idea is to parse it into a dictionary that takes fieldfoo as the key and whateve...
Coagulase asked 31/1, 2012 at 0:30
4
Solved
Here's an interesting one. I'm writing an AES encryption algorithm, and have managed to get it making accurate encryptions. The trouble comes when I attempt to write the result to a file. I was get...
Handclap asked 29/11, 2013 at 23:34
5
Solved
I need to conver Pretty format json file into a single line json file. But unable to do so. Can anyone help me on this?
Example: the below needs to be converted
[
{
"Employee ID": 1,
&...
4
Solved
7
Solved
This question is pretty much the opposite of this question:
Does C# have built-in support for parsing page-number strings?
So given
1,3,5,6,7,8,9,10,12:
I will ouput:
1,3,5-10,12
Here is my...
1
Solved
string.find("MOZ-MAIL-1-1","MOZ-MAIL-")
string.find("MOZ-MAIL-1-1","OZ-MAIL-")
Given the above, why do those return false, but the following succeed?
string...
5
I just stumbled across this and I couldn't find a sufficient answer:
x = ""
Why then is:
x == True
False
x == False
False
x != True
True
x != False
True
Am I supposed to conclude that x is...
5
Solved
I am struggling to parse the location strings I have in my data.
The location is inconveniently set up as a string with both the latitude and longitude info bundled together and I want to extract t...
Newlywed asked 29/5 at 19:24
3
Solved
7
I have the following letter sequence: "MGGGRYSGTK"
I wish to keep all the Gs in the same spot, but shuffle the remaining letters. The code I have so far is as follows. I need help on how ...
8
Solved
I want a shortest way to get 1st char of every word in a string in C#.
what I have done is:
string str = "This is my style";
string [] output = str.Split(' ');
foreach(string s in output)
{
Cons...
22
I need to create a method that receives a String and also returns a String.
Ex input: AAABBBBCC
Ex output: 3A4B2C
Well, this is quite embarrassing and I couldn't manage to do it on the intervie...
Lammas asked 18/5, 2012 at 6:4
7
Solved
I'm trying to cast a CHARACTER VARYING column to a DATE but I need a date format like this : DD/MM/YYYY. I use the following SQL query :
ALTER TABLE test
ALTER COLUMN date TYPE DATE using to_date...
Hocker asked 19/6, 2014 at 8:23
6
Is it posible to check if a string contains a substring with locale support?
'Ábc'.contains('A') should be true.
Javascript now has the string.prototype.localeCompare() for string comparison with...
Quartziferous asked 17/9, 2016 at 15:4
© 2022 - 2024 — McMap. All rights reserved.