Euhmmm...... :-| yes you are right,,, forgot something
Dim NewString as string = string.empty
Dim Oldstring as string ="X"
If Not string.IsNullOrEmpty(oldString) AndAlso oldString.Length>1 then
newString = oldString.SubString(0, oldString.Length - 1)
else
NewString=OldString
end if
Cause in case of a one char string i asume the TS wants the original value
and not a empty string
in the case he wanted a empty string in this sitaution he can remove the
length and else struct
"Chris Dunaway" <dunawayc@gmail.comschreef in bericht
news:d7b7ae52-ebd7-42e8-8ccc-fe8589579d5f@m45g2000hsb.googlegroups.com...
Quote:
On Aug 27, 3:43 pm, "Michel Posseth [MCP]" <M...@posseth.comwrote:
>
Quote:
>If Not string.IsNullOrEmpty(oldString) AndAlso oldString.Length>1 then
>
Isn't the check for the length of the string here, unnecessary? If
the call to IsNullOrEmpty returns False, then by definition, it's
length must be at least 1.
>
Chris