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?
Hame asked 5/3, 2016 at 16:38

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:...
Twoway asked 27/8, 2012 at 18:27

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...
Nanananak asked 7/12, 2013 at 20:25

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...
Audiophile asked 25/11, 2011 at 17:20

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...
Geometrid asked 9/4, 2015 at 19:19

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, &...
Samualsamuel asked 17/2, 2021 at 8:46

4

Solved

I'd like to convert the JSON string "{ \"birthday\": \"1988-03-18\", \"address\": { \"state\": 24, \"city\": 8341, \"country\": 1 } }" to "{ \"address\": { \"city\": 8341, \"country\": 1, \"sta...
Duvetyn asked 19/1, 2013 at 18:8

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...
Procephalic asked 7/10, 2011 at 14:45

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...
Pout asked 31/5 at 0:46

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...
Viridis asked 15/3, 2016 at 13:57

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

Say I have the following: 44-xkIolspO I want to return 2 variables: $one = "44"; $two = "xkIolspO"; What would be the best way to do this?
Gadson asked 19/1, 2011 at 3:0

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 ...
Raama asked 7/5 at 8:42

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...
Bosworth asked 17/1, 2011 at 13:4

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.