Tagged Questions
0
votes
1answer
71 views
How to get the string inside [[ string ]] inside a string ? (C#)
As you have seen in C# a statement is inside braces as { }
Now what if we have a string that contains multiple strings inside [[ ]] these.
Sample input output:
string s = "this is the string I am ...
2
votes
3answers
49 views
C# DataContract with non-constant variable names
I'm trying to parse a JSON file using a data contract in C#, however I have a problem since member names are not always constant, but the structure is.
Take this JSON for example (created by texture ...
1
vote
1answer
48 views
Parse string to produce predicate
I need to parse a string and produce a predicate (or expression, I'm not bothered) where the string takes the form:
"> 30"
I'd rather not write my own and there's a few libraries that do stuff like ...
0
votes
1answer
239 views
FileHelpers Error and RecordString
I am having a curious problem with FileHelpers. When parsing a csv file, if I have set the IgnoreFirstLines parameter of the engine to anything >0, and the first error that is encountered is on the ...
-2
votes
1answer
88 views
Removing tables, shapes and images from .doc file
I am parsing a .doc file in C# for extracting text.
The problem is that the .doc file has tables, shapes and images, as well as my text. I use Microsoft Interop Word library for extracting text. ...
2
votes
4answers
81 views
JSON parsing of a complex object
Given below is the type of JSON response ,
{
"?xml":{
"@version":"1.0",
"@encoding":"iso-8859-1"
},
"xmlreport":{
"@title":"ABC: TEST Most Saved2",
"@dates":"Week of May ...
3
votes
3answers
60 views
TryParse Nullable types generically
I have written overloaded static TryParse methods for the following Nullable types: int?, short?, long?, double?, DateTime?, decimal?, float?, bool?, byte? and char?. Below is some of the ...
40
votes
12answers
18k views
What is the C# equivalent of NaN or IsNumeric?
This seems like a fairly simple question, and I'm surprised not to have required it before. What is the most efficient way of testing a string input is a numeric (or conversely Not A Number)? I guess ...
11
votes
5answers
179 views
Fastest way to check if a string can be parsed
I am parsing CSV files to lists of objects with strongly-typed properties. This involves parsing each string value from the file to an IConvertible type (int, decimal, double, DateTime, etc) using ...
1
vote
2answers
34 views
How to search for a .jpg/PDF with just the file name (Search “dog.jpg” with just “dog”) Can it be done? C#
Is there a way to search for a jpg or PDF if you just have the name of the file?
Dummy site: www.dummysite1.com/animal=dog
What I want to do is parse the URL, take the parsed name "dog" and search ...
0
votes
2answers
648 views
want to write MS-Access like query builder in c?#
we want to create MS-Access LIKE query parser where user can create complex queries having joins?
any thoughts on design in c#?
0
votes
2answers
29 views
Parsing App.Config data to a list of objects
First off I'm not sure what the best way to go about this is, but here is my scenario, I have a large number of accounts that need to be read in a test suite. I was going to store them in xml format ...
1
vote
2answers
58 views
How to query JSON array with C#, For a specific Property
I need to get a JSON property dynamically at run time. The JSON looks like this:
{
"timestamp": 1369828868,
"base": "USD",
"rates": {
"AED": 3.673416,
"AFN": 54.135233,
"ALL": ...
0
votes
1answer
21 views
Getting links from table via HtmlAgilityPack
I have simple html table:
<table>
<tr>
<td>
<a href="http://someurl_1.com">item name1</a>
</td>
<td>
Value 1
</td>
...
1
vote
1answer
77 views
How to elegantly parse the following text into a dictionary
I have the following text that I need to put into a dictionary. At first sight I thought that it would be very easy but at the end I found myself doing extensive string search and finding sometimes ...