F Frank Oquendo Dec 1, 2003 #2 John said: How can I detect a NULL string using C# ? Thanks. Click to expand... Not sure what you mean by a null string so just in case, here's two options: Null: if (myString == null) Empty: if (myString == "") -- There are 10 kinds of people. Those who understand binary and those who don't. http://code.acadx.com (Pull the pin to reply)
John said: How can I detect a NULL string using C# ? Thanks. Click to expand... Not sure what you mean by a null string so just in case, here's two options: Null: if (myString == null) Empty: if (myString == "") -- There are 10 kinds of people. Those who understand binary and those who don't. http://code.acadx.com (Pull the pin to reply)
C Cowboy \(Gregory A. Beamer\) Dec 1, 2003 #3 Null string, as in char(0) or a string that is null: if(stringName == null) { // you detected a null string } char[] charArray = stringName.ToCharArray(); //Assume only one char if it is a null char if(charArray[0] == 0) { // only a null char } I am flying by the seat of my pants here, so you may have to alter the code to get past debug. The theory is sound, however. -- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA ********************************************************************** Think Outside the Box! **********************************************************************
Null string, as in char(0) or a string that is null: if(stringName == null) { // you detected a null string } char[] charArray = stringName.ToCharArray(); //Assume only one char if it is a null char if(charArray[0] == 0) { // only a null char } I am flying by the seat of my pants here, so you may have to alter the code to get past debug. The theory is sound, however. -- Gregory A. Beamer MVP; MCP: +I, SE, SD, DBA ********************************************************************** Think Outside the Box! **********************************************************************
S Steven Alexander Dec 1, 2003 #4 Are you trying to test onde columns returned from database? You can use the function isDbNUll(FIELD) Steven Alexander
Are you trying to test onde columns returned from database? You can use the function isDbNUll(FIELD) Steven Alexander
F Flare Dec 1, 2003 #5 How can I detect a NULL string using C# ? if you mean an empty string. if( aString == string.empty )