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.

943 questions
-2
votes
2 answers

How do I parse a string based on a certain number of characters in the string in C++?

I know how to parse a string based on a delimiter, such as a comma. Does this require turning the string into an array of char? I am wanting to compare a string that is 6 numebrs i.e. 111222 with another string of numbers that is 12 characters long…
WorthAShot
  • 81
  • 1
  • 5
-2
votes
3 answers

Parsing a complex number

I am trying to take a complex number input from the user in a form of a char or string like: 88.90-55.16i or -3.67+5i and then convert it to float keeping the same format as above. Not (x,y). char user[100]; vector < float > V; for (int y =…
Bob Jack
  • 3
  • 2
-2
votes
2 answers

Converting Int32 to binary in c++

I'm asking for help here after searching all around the web I'm working on a school project, in Windows Forms, using managed C++. My problem is that I've got an Int32 value and I need to convert it to a binary value using System::Convert but I don't…
Rameleu
  • 105
  • 10
-2
votes
3 answers

Parsing string to array using Regex in c#

im currently making an c# application that receives a string from an serialport, and i need to parse this data so i can do stuff with it. The strings that are send through the SerialPort are formatted like…
-2
votes
3 answers

Reading a text file in a particular way

Let's assume that I have the following input 8 2 I slept long 8 3 5 Students didn't do well 9 1 What should I do? seriously 9 5 I have no idea what to do from now on stored in wow.txt. I wanted to take two integers and the string separately for…
user98235
  • 702
  • 1
  • 7
  • 23
-2
votes
1 answer

Comma-Separated String to Double C#

I want convert 1,2,3,4,5,6,7,8,9,10 String to Double. I tried Convert.ToDouble(String); and Double.Parse(String); but returned 1.0 How to convert multi comma string to double? Thanks for help.
user3877422
  • 2,287
  • 3
  • 10
  • 6
-2
votes
1 answer

Find specific value in matrix algorithm

I have this matrix and I want to find a algorithm that can find all values = 1 and give give me the count of how many there are. My matrix look like this and have the size n x n: 44444444 4 4 1 4 4 4 444 4444 44 4 1 34 444 444 44 …
-2
votes
2 answers

can storing data in a database sometimes lead to corrupted data?

I have a field that's stored in the database as a string. It's actually a comma-separated string of numbers that I convert to a list of longs. The lines of code that do the conversion look somewhat like this: TheListOfLongs = (from string s in…
frenchie
  • 46,331
  • 96
  • 283
  • 483
-2
votes
1 answer

String function task in javascript

Hi guys I'm trying to take a URL of the form http://www.domainname.com/stuff/morestuff/content?extrastuff And using a JavaScript string function parse out "content" based on the surrounding regular expressions "morestuff/" and "?". Any help would…
Ben Pearce
  • 6,162
  • 16
  • 64
  • 122
-2
votes
2 answers

perl regex for a string

I have a string from where I need to extract street , city , state , zip . The string may look like a)$str1 ="2500 South 3850 West Suite A Salt Lake City, UT 84120-7225"; b)$str2 ="19701 DaVinci Lake Forest, CA 92610"; c)$str3="abc…
jnanchak
  • 3
  • 5
-3
votes
1 answer

Mysql->PHP->Java - How to avoid losing information in strings?

I am trying to make an android app, and I am using some userbased input from mysql. I output it with php and load it with java. There can be plenty of results. At the moment my output could be. IDS: 1,4,7,3,9 MSG ffsdf,sdfs,dfsd,fsdfsdf,sdfsfd But…
NikolajSvendsen
  • 335
  • 2
  • 8
  • 16
-3
votes
1 answer

C# {String was not recognized as a valid Datetime}

Well I"m trying to read a csv file in my directory but it has a DateTime value. The thing is I'm trying to read the value but shows me this error: String was not recognized as a valid Datetime this is the library from where im calling the value…
-3
votes
1 answer

How to extract only numbers inside of double quotes with regex

useragent "VeracodeJenkinsPlugin/18.11.5.8 (Jenkins/2.150.3; Java/1.8.0_181)" 16:02:43.582 [19.07.18 14:02:43] 16:02:43.582 [19.07.18 14:02:43] Application profile "Cleared Derivatives Solution" (appid=74386) was located. 16:02:43.582 [19.07.18…
-3
votes
1 answer

How to parse a string in order to convert it to nsattributedstring

I have a string in the form of "@{profile: id1} is going to @{profile: id2}'s party" How do I convert it to nsattributedstring "**Name1** is going to **Name2**'s party" Both id1 and id2 represent a string. You can get Name1 by pass id1 into a…
Zion W
  • 15
  • 6
-3
votes
3 answers

Parsing a string in C to individual words

I'm looking at writing a function that parses a given string input and separates the string into its constituents (as defined by one or more space characters). If I was to have a guess at the layout of the function, I think it would look something…
Sam Talbot
  • 25
  • 1
  • 1
  • 6
1 2 3
62
63