Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Menu Scripts - Null String Empty Menu Scripts - Null String

Thu 23 Jan 2020 - 8:56
Within the Menu Scripts, I need to use 4 strings and I declare them right at the start, however, if I decare a string that returns a Null value whilst the Script reports no errors, the outcome in Word or Oyez is always ....Not found. How do youset a IF statement to check if there is a null value and thenrunset the string?
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Menu Scripts - Null String Empty Re: Menu Scripts - Null String

Thu 23 Jan 2020 - 8:56
You can declare the string variable as empty to begin with then check it with string.IsNullOrEmpty(string) string name = string.Empty; if (string.IsNullOrEmpty(name)) { name = “test”; ... ... }
Back to top
Permissions in this forum:
You cannot reply to topics in this forum