Linked Questions

0 votes
3 answers
5k views

Possible Duplicate: Why is there no Char.Empty like String.Empty? I want to pass an empty char as a method parameter and I was wondering why I cannot say char.Empty while C# allows me to specify ...
pencilCake's user avatar
  • 53.8k
126 votes
10 answers
175k views

I have a string like this: string val = "123-12-1234"; How can I replace the dashes using an empty string in C#. I mean val.Replace(char oldChar, newChar); What needs to go in oldChar and newChar.
SaiBand's user avatar
  • 5,425
128 votes
10 answers
487k views

I'm currently writing a little program but I keep getting this error when compiling error: empty character constant I realize it's because I'm trying to replace a valid char with empty space c[i]='' ...
user avatar
14 votes
5 answers
1k views

I have a string like string Text = "012345678901234567890123456789"; and a List<int> with indexes List<int> Indexes = new List<int>() { 2, 4, 7, 9, 15, 18, 23, 10, 1, 2, 15, 40 }; ...
Byyo's user avatar
  • 2,263
5 votes
6 answers
29k views

for example when I wrote: Char[] test = new Char[3] {a,b,c}; test[2] = null; it says Cannot convert null to 'char' because it is a non-nullable value type if I need to empty that array of char, is ...
Hendra Anggrian's user avatar
2 votes
2 answers
4k views

I'm writing a Linq extension method, to make a p455w0rd from a string input. public static IEnumerable<char> ToPasswordFormat(this IEnumerable<char> source) { var enumerator = ...
happygilmore's user avatar
  • 3,125
4 votes
3 answers
12k views

Is there any specific reason why there is no empty char literal? What comes closest to what I think of, the '' is the '\0' the null character. In C++ the char is represented by an int, which means ...
Mare Infinitus's user avatar
3 votes
4 answers
480 views

In Java, what is the difference between "" (empty quotes) and " " (quotes with a single space) and how do I test the former in terms of a char?
jgatcher's user avatar
  • 175
5 votes
2 answers
355 views

When I try to use '\0' as a character in F# it doesn't work. Here is what I see: I have read elsewhere that Char.MinValue will accomplish the same thing though. Is there any reason why '\0' is not ...
Nathaniel Elkins's user avatar
2 votes
3 answers
4k views

I am trying to assign empty char using Private m_ClientAreaCode As Char = '' But I am not able to assign.
user3603130's user avatar
1 vote
3 answers
599 views

i stumbled upon this bit here in a project from a colleague: foreach (var invalidChar in Path.GetInvalidFileNameChars()) fileName = fileName.Replace(invalidChar, '\0'); the gerenal idea is ...
garglblarg's user avatar
1 vote
3 answers
2k views

I have re-coded to avoid embedded null characters in C# strings,... but was wondering why the following calls gave no warning or exception for string parameters with an embedded null character, and ...
ergohack's user avatar
  • 1,396
1 vote
2 answers
994 views

I have a code which sends a POST request to a web application and parses the response. I'm sending the request with following code: byte[] responseBytes = webClient.UploadValues("https://example....
Robert Zunr's user avatar
-1 votes
2 answers
1k views

I need to do two things with strings: A. Remove the file extension B. Remove the '-' from the dates. An example of an uploaded string is: ifrs_au-cor_2013-03-12.xsd I can't just do a replace on '-' ...
oe a's user avatar
  • 2,280
0 votes
1 answer
433 views

What is the equivalent of this line in C#? // In Java: string[] split = val.Split("\u0000"); I know that: The Java split function takes a regular expression. "\u0000" is the null character in Java. ...
NightOwl888's user avatar
  • 57.1k