There are plenty of methods to achieve this but even though it’s simple task you need to specify requirements like: are white spaces allowed? how to treat empty string? what’s the maximum length of the string? In this article I want to describe 3 different ideas how to solve this problem. Custom function Let’s say … Continue reading C# – How to check if string contains only digits
Category: How To
C# – How to generate Guid
.NET Framework provides built-in Guid structure which allows to generate unique identifier. The usage is very simple and requires to call NewGuid function on Guid structure. Guid guid = Guid.NewGuid(); 1 Guid guid = Guid.NewGuid(); Returned object type is Guid however we can easily convert it to string. var guidString = guid.ToString(); 1 var guidString = … Continue reading C# – How to generate Guid