About 746,000 results
Open links in new tab
  1. How to return an array literal in C# - Stack Overflow

    It's also worth nothing that C# doesn't actually have array literals, but an array initialization syntax - to which the accepted answer refers. Literals are special in that they can be directly serialized, and can …

  2. c# - Array with literal strings - Stack Overflow

    Jul 2, 2015 · But what will be the content of each element of the array on heap ? Actual string literals ? References pointing to string literals in intern pool ?

  3. c# - All possible array initialization syntaxes - Stack Overflow

    What are all the array initialization syntaxes that are possible with C#?

  4. Can't use an "inline" array in C#? - Stack Overflow

    May 28, 2015 · I'm not familiar with C# terminology, but I believe this is more commonly called a literal or an array literal rather than an inline.

  5. Converting string to byte array in C# - Stack Overflow

    Apr 18, 2013 · As of C# 11 (.Net 7) it is possible to just prefix a string literal with "u8" to convert it into a UTF-8 encoded byte[] or ReadOnlySpan<byte>. In case you need to use UTF-16 encoding, you can …

  6. c# - Declare a const array - Stack Overflow

    string isn't a char [], see the source. Strings can be consts in C# because the compiler will replace all references to the const with the actual string literal itself.

  7. c# - Options for initializing a string array - Stack Overflow

    Sep 3, 2013 · Options for initializing a string array [duplicate] Asked 16 years, 3 months ago Modified 12 years, 4 months ago Viewed 244k times

  8. How do I initialize an empty array in C#? - Stack Overflow

    Jan 4, 2012 · Is it possible to create an empty array without specifying the size? For example, I created: String[] a = new String[5]; Can we create the above string array without the size?

  9. c# - Initializing ArrayList with constant literal - Stack Overflow

    Nov 12, 2009 · The C# 3 collection initializer is the solution for me because: 1. it compiles on my (special) version of .net 2. does not create a new object. (memory is an issue in this case)

  10. Split a string into an array c# - Stack Overflow

    Aug 2, 2014 · public string info12 = "0, 50, 120, 10"; One of you might be thinking, eh? Isn't than an integer array? Well it needs to stay a string for the time being, it must be a string. How can I convert …