All Questions
80
questions
-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"}
...
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": []
}...
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&...
-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 ...
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 ...
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?
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 = ...
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 ...
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> ...
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");
...
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> ...
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 ...
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 ...
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 ...
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 ...