Logo

Programming-Idioms

History of Idiom 110 > diff from v28 to v29

Edit summary for version 29 by jakea:
New Csharp implementation by user [jakea]

Version 28

2019-02-02, 02:48:56

Version 29

2019-09-26, 13:55:10

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Code
bool blank = string.IsNullOrWhiteSpace(s);
Doc URL
https://docs.microsoft.com/en-us/dotnet/api/system.string.isnullorwhitespace?view=netframework-4.8
Demo URL
https://dotnetfiddle.net/NBtvu2