substring Questions

5

Solved

I want to add a substring (text) at beginning of string only if this string doesn't have already this text at beginning. Example: // let's say I want to add "Has" at beginning (if doesn't...
Arguelles asked 20/6, 2019 at 16:21

9

Solved

Is it possible in PowerShell, to truncate a string, (using SubString()?), to a given maximum number of characters, even if the original string is already shorter? For example: foreach ($str in "h...
Balsam asked 14/1, 2015 at 13:38

1

Solved

I have a Prometheus metric as shown below query_duration{query = "SELECT * FROM TABLE_NAME"} I'm trying to extract only TABLE_NAME from the label query. I'm trying to use regex to extrac...
Hembree asked 19/6 at 9:53

4

Solved

I have strings that look like {ABCDE}{F1} {GHIJ}{K12} I want to extract the text between the first curly brackets ABCDE GHIJ I tried searching online but a lot of answers seem to be using fun...
Calandra asked 24/4, 2018 at 14:43

9

Solved

I am trying to create a program that detects if multiple words are in a string as fast as possible, and if so, executes a behavior. Preferably, I would like it to detect the order of these words to...
Odel asked 19/9, 2013 at 1:46

29

Solved

For example, assuming that x = filename.jpg, I want to get filename, where filename could be any file name (Let's assume the file name only contains [a-zA-Z0-9-_] to simplify.). I saw x.substring(...
Fasto asked 22/11, 2010 at 21:24

3

I'm new in C# and need to read float values (x, y, z) from file. It looks like: 0 -0.01 -0.002 0.000833333333333 -0.01 -0.002 If Iam trying float number = float.Parse("0,54"); // it wor...
Miranda asked 31/12, 2014 at 13:48

6

Solved

I am using the Tmail library, and for each attachment in an email, when I do attachment.content_type, sometimes I get not just the content type but also the name. Examples: image/jpeg; name=exampl...
Apace asked 18/4, 2012 at 18:26

19

Solved

How do I replace part of a string with another string using the standard C++ libraries? QString s("hello $name"); // Example using Qt. s.replace("$name", "Somename"); ...
Quiles asked 5/8, 2010 at 19:6

4

Solved

I have a json object with one of field having values for example "countries-sapi-1.0", "inventory-list-api-1.0-snapshot" Note that the first one has sapi and the other one has a...
Sungkiang asked 29/3, 2018 at 8:55

15

How do I get a long text string (like a querystring) to display a maximum of 10 characters, using JQuery? Sorry guys I'm a novice at JavaScript & JQuery :S Any help would be greatly appreciate...
Scenarist asked 5/8, 2010 at 13:5

13

Solved

I am trying to extract everything before the ',' comma. How do I do this in JavaScript or jQuery? I tried this and not working.. 1345 albany street, Bellevue WA 42344 I just want to grab the stree...
Sudden asked 3/2, 2012 at 17:49

4

Solved

It is mentioned on the ECMAScript standard here that : ... These features are not considered part of the core ECMAScript language. Programmers should not use or assume the existence of these featu...
Retrieve asked 4/10, 2018 at 6:21

16

Solved

How can I get the last n characters from a string in R? Is there a function like SQL's RIGHT?
Counterespionage asked 1/11, 2011 at 8:11

24

Solved

How do I implement the following (Python pseudocode) in C++? if argv[1].startswith('--foo='): foo_value = int(argv[1][len('--foo='):]) (For example, if argv[1] is --foo=98, then foo_value is 98...
Cumming asked 10/12, 2009 at 0:57

13

Solved

How do I only get the first 10 words from a string?
Slusher asked 10/5, 2011 at 21:20

2

Solved

I'm trying to select the first part of a string with a delimiter that doesn't always exist. I have the below SUBSTRING function that works great when the delimiter is present, but doesn't return an...
Salutary asked 27/3, 2015 at 17:14

3

I need to split a field(Name) into Two (First Name and Last Name) based on a comma in Informix. Example: "Mark, Wheeler J" has to be split as Mark and Wheeler. I have tried using SQL syntax but i...
Giveandtake asked 26/12, 2013 at 22:23

21

Solved

I've got dirty data in a column with variable alpha length. I just want to strip out anything that is not 0-9. I do not want to run a function or proc. I have a script that is similar that just g...
Weirdo asked 4/9, 2013 at 23:41

8

Solved

I have an array and in that array I have an array key that looks like, show_me_160 this array key may change a little, so sometimes the page may load and the array key maybe show_me_120, I want to ...
Decury asked 14/10, 2010 at 9:59

21

How could I replace a substring in a string with another substring in C++, what functions could I use? eg: string test = "abc def abc def"; test.replace("abc", "hij").replace("def", "klm"); //rep...
Natal asked 10/1, 2011 at 3:42

5

I know the brute force approach with the time complexity of n*m (m is length of first string and n is the length of the other one) for testing if an string contains another one, however, I'm wonder...
Duckling asked 25/8, 2013 at 23:6

4

Solved

I want to get the name of the currently running batch file without the file extension. Thanks to this link, I have the file name with the extension... but what is the best way to do a substring i...
Morningglory asked 11/3, 2009 at 21:8

6

Solved

Is there a function in PHP that takes in a string, a number (i), and a character (x), then replaces the character at position (i) with (x)? If not, can somebody help me in implementing a function w...
Dysgraphia asked 22/10, 2010 at 6:2

9

Solved

Suppose I have the following string: Rückruf ins Ausland I need to insert it into the database which has a max size of 10. I did a normal substring in java and it extracted this string Rückruf in w...
Amorphous asked 16/7, 2015 at 13:32

© 2022 - 2024 — McMap. All rights reserved.