Logo

Programming-Idioms

History of Idiom 110 > diff from v65 to v66

Edit summary for version 66 by zqwnvl:
[VB] Implement the lead fully; add links

Version 65

2021-08-17, 11:21:18

Version 66

2021-08-19, 09:05:41

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
Dim myString As String = "abcdefg"
If String.IsNullOrEmpty(myString) Then
    '''
End If
Code
Dim blank As Boolean = String.IsNullOrWhitespace(s)
Doc URL
https://docs.microsoft.com/en-us/dotnet/api/system.string.isnullorwhitespace
Demo URL
https://sharplab.io/#gist:8a925b62c073bb5893378818f0b870cd