Why Guid.TryParse allows trailing/leading spaces
One of our existing codes failed because a developer used Guid.TryParse to check if an input string is a valid Guid value and the input itself has a trailing space. if (Guid.TryParseExact("0c652e2a-ef02-4eff-8855-78122d8b6c0b ", "D", out var guid1)) _logger.LogWarning("guid1"); if (Guid.TryParse("0c652e2a-ef02-4eff-8855-78122d8b6c0b ", out var guid2)) _logger.LogWarning("guid2"); if (Guid.TryParse(" 0c652e2a-ef02-4eff-8855-78122d8b6c0b ", out var guid3)) _logger.LogWarning("guid3"); if (int.TryParse("… Read More Why Guid.TryParse allows trailing/leading spaces