Trivial I know, but just interested
I've got a stringbuilder variable, that I want to return the contents of, but if it's empty I want to return "|", so is it best to use stringbuilder.tostring in the compare statement e.g
If lReturnStringBuilder.ToString = String.Empty Then
lReturnStringBuilder.Append("|")
End If
return lreturnStringBuilder.tostring
or is it best to convert it to a string, and compare that, even though that means loading up a new variable and the allocating string space for that e.g
Dim lString as string = lReturnStringBuilder.ToString
if lString = string.empty then
lstring = "|"
end if
return lString