Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
-1 votes
3 answers
160 views

How to create an object dynamically from a string array?

I have a String array in C# like below: String[] myArray = {"1","Jack","18","2","John","22","3","Mark","29"} ...
Jesus Hamdi's user avatar
0 votes
1 answer
553 views

Find all Id's in json object

I have a long tree json document, here is the part of it "childs": [ { "id": "id1", "name": "name1", "childs": [] }...
Alexey Savelyev's user avatar
0 votes
2 answers
564 views

Parse Json string to find all values of same element

I have a json as below. { "name": "", "id": "test1", "properties": { "name1": [ { "id&...
Praveen kumar's user avatar
-2 votes
1 answer
175 views

C# Best practices for check objects and strings [closed]

I work on Xamarin.Forms application and want to check all possible scenarios. For example i got this code: User user= new User(); string token= string.Empty i got a instance of object user and ...
RazrMan's user avatar
  • 163
0 votes
1 answer
166 views

Insert new Dictionary entries of <UserStatus (enum), IEnumerable<string>> into different keys

we are doing the following programming exercise: Who's Online. We have written the following code: using System; using System.Collections.Generic; public static class Kata { public static ...
Yone's user avatar
  • 2,114
0 votes
1 answer
70 views

How to convert object to array in c#? [closed]

jsonResult["filePath"] {[ "D\\test.pdf" ]} How to get this filepath? Cant able to convert this object into array. Any other way to achieve this filePath?
Gokul Kumar's user avatar
0 votes
1 answer
96 views

How do I ignore every input after the first few characters in the console in C#?

class Program { static void Main(string[] args) { var information= Console.ReadLine(); var one= Int32.Parse(informatie.Split(' ')[0]); var two = ...
John Doe's user avatar
2 votes
2 answers
954 views

How to ensure case insensitive comparison on strings when comparing unknown object types?

I have a DataGridView that I am writing some generic code to add filters to. The underlying data types for the columns could be anything, however if they are strings I would like the filter to use a ...
BVernon's user avatar
  • 3,597
0 votes
1 answer
4k views

C# how can I loop through all Elements of a List <string>

I have the following problem. I have a list of strings and want to split these. After that, I want to give each Object Element a reference to an item of the List. Example: List<string> ...
brstkr's user avatar
  • 1,553
1 vote
2 answers
230 views

Is there a way to check if any existing object contains a specific string paramater?

Alright, so here- I have three objects. public static module foo = new module("John", "A"); public static module bar = new module("Nick", "B"); public static module qux = new module("Alex", "C"); ...
Akuhyo's user avatar
  • 23
0 votes
1 answer
345 views

How can I extract a string out of an object that contains this string?

I created a Yaml that looks like this: Directories: - ./Libraries: - DLLList.yml - ./Output: - None Now I deserialized that yaml into a list of Objects: List<object> ...
DudeWhoWantsToLearn's user avatar
0 votes
1 answer
650 views

Difference when comparing int and string having dynamic, object and int/string as parameter?

I tried to compare two int values and two string values using equals operator ' == '. I used 3 functions which have as input parameter type dynamic, object and int/string. When I compare using a ...
Daniel's user avatar
  • 393
0 votes
1 answer
423 views

How to design a String class with MaxLength?

I am planning to create my own string class, but it will have a max length provided. Let's call it "lString". I want to use "lString" just like a "string" class in my code. But I will be able to set a ...
Pecheneg's user avatar
  • 798
2 votes
1 answer
522 views

Why does string.Join(" ", new object[] { null, "a", null, "b"}) retruns string.Empty? [closed]

I noticed that string.Join(" ", new object[] { null, "a", null, "b"}) returns string.Empty Notice that string.Join(" ", new string[] { null, "a", null, "b"}) returns a b (as I would expect) Things ...
manuc66's user avatar
  • 2,819
2 votes
3 answers
103 views

c#, How to use a string not as a string but as the name of an object in another class?

Have searched in other questions but haven't found how to do in c#. Tried using the Map function, but it's not availabe in c#. I want to use a for loop to refer to values in objects in StrainsManager ...
Mohammad Nadeem's user avatar

15 30 50 per page
1
2 3 4 5 6