Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 18, 2012 09:22 AM by oned_gk
Member
71 Points
68 Posts
Dec 18, 2012 08:58 AM|LINK
Hi --
I would like to convert the following
public static String CleanEmptyString(String value) { if(!String.IsNullOrEmpty(value)) value = value.Replace("\0", String.Empty); return String.IsNullOrEmpty(value) ? String.Empty : value; }
...and have it return a SPACE rather than a null value. I realize this is fairly simple. Can someone help me out?
Thanks.
Cindy
All-Star
86795 Points
9644 Posts
Moderator
MVP
Dec 18, 2012 09:11 AM|LINK
Just change the return statement to this:
return String.IsNullOrEmpty(value) ? " " : value;
31760 Points
6489 Posts
Dec 18, 2012 09:22 AM|LINK
Cindy123
Member
71 Points
68 Posts
Null Values?
Dec 18, 2012 08:58 AM|LINK
Hi --
I would like to convert the following
public static String CleanEmptyString(String value) { if(!String.IsNullOrEmpty(value)) value = value.Replace("\0", String.Empty); return String.IsNullOrEmpty(value) ? String.Empty : value; }...and have it return a SPACE rather than a null value. I realize this is fairly simple. Can someone help me out?
Thanks.
Cindy
DarrellNorto...
All-Star
86795 Points
9644 Posts
Moderator
MVP
Re: Null Values?
Dec 18, 2012 09:11 AM|LINK
Just change the return statement to this:
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.
oned_gk
All-Star
31760 Points
6489 Posts
Re: Null Values?
Dec 18, 2012 09:22 AM|LINK