Questions tagged [string-parsing]

The action of retrieving data from a string

String parsing is the action of extracting or modifying data pieces from a string. For example, one might parse a string to remove all quotation marks or to find all items inside quotation marks.

970 questions
-4
votes
1 answer

How can I pick a specific random string up from an arrayString?

I have a situation where I received an input string with a random value contained there ("54403dd5-5f1d-4ba0-8477-9b16807ee285") basically that string is received from another source code but I just pasted there for reference, also notice that I…
Cesar
  • 49
  • 1
  • 3
-4
votes
1 answer

Parse a char string in c to get just the numeric digits after the exclamation mark

If I have something like !23 How can I parse it to get just the number part? Input: !23 Output: 23 Input: ! Output: Error Input: !23eds3 Output: Error This is my approach of getting the numeric digit. But for some reason strcpy is messing up my…
smriti
  • 1,073
  • 1
  • 13
  • 25
-4
votes
1 answer

Hex To Int In Python No Int Constructor

I'm trying to turn a string representing a Hexidecimal number into an int in python without using the int constructor. For example if I was given hexstring = "802" How would I get that to be output = 2050 Without doing …
-4
votes
1 answer

Swift - Parse a String to extract and edit numbers in it

Given a String taken from the internet, such as: "A dusting of snow giving way to moderate rain (total 10mm) heaviest on Thu night. Freeze-thaw conditions (max 8°C on Fri morning, min -2°C on Wed night). Mainly strong winds." Using Swift 3, I want…
Justin Lewis
  • 534
  • 1
  • 5
  • 22
-4
votes
1 answer

Get an Integer that can be modified from a String?

So, the full String that I'm trying to read is: Members online: (0/0): Members offline: (0/0): While I think I could substring it to get the 0, it can change it's size, because it's an int... Is there any way I could get the integers even if they…
John M
  • 23
  • 2
  • 5
-4
votes
2 answers

which function should I use for split the string

I am doing a Date class which takes a string as a parameter that is like : 11/13/2007 9/23/2008 9/23/2008 ... and set it month, date and year objects, How can I use the substr() function, or are there any other functions ?
pflove
  • 25
  • 8
-4
votes
2 answers

What is the cheapest way in .net to determine enumeration-vs-number?

I am trying to determine whether a given string is an enumeration value or not. It is rather common that the string should be a decimal value. My question is whether it takes longer to do an Enum.TryParse() on the string or to do a regex check…
Tevya
  • 836
  • 1
  • 10
  • 23
-4
votes
1 answer

I have a file with this data

2012-05-10 BRAD 10 2012-05-08 BRAD 40 2012-05-08 BRAD 60 2012-05-12 TOM 100 I wanted an output as 2012-05-08 BRAD|2|100 2012-05-10 BRAD|1|10 2012-05-12 TOM|1|100 i started with this code:: import…
-5
votes
1 answer

How would I remove everything from a string except keywords in Perl?

I have a string like this: component.kw1_tap/rt (path/to/file1/kw1) (path/to/file2/kw2) I am able to remove the unwanted chars and produce a clean string like this: component kw1 tap rt path to file1 kw1 path to file2 kw2 now i want to remove…
infinitloop
  • 2,863
  • 7
  • 38
  • 55
-7
votes
4 answers

Parse string with arithmetic operation

I have a string of the following type: "23 + 323 =" or "243 - 3 =" So the format is: number + operator + number = equal. And I also have an int which is the answer to that question. How can I parse the string and check if the answer is…
Miguel Moura
  • 36,732
  • 85
  • 259
  • 481
1 2 3
64
65