logo       

Clean way to do string.join: msg#00196

org.user-groups.dotnet.padnug

Subject: Clean way to do string.join


Hi all:

I like to use a lot string functions since formulating an
expression can be a pain. I tried to use string.join to make a simple
AND clause, "X AND Y AND Z", any of them can be empty, i.e., if X is
empty, it becomes "Y AND Z". However I noticed string.join is not that
smart, it does not treat empty string or null string differently, and
output " AND Y AND Z".



I hate to do an elaborate if else since I need to do
multiple branches for different combinations. Any efficient way to
address string.join's short coming? Shouldn't it no do a join if string
element is empty?













[Non-text portions of this message have been removed]






<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise