Microsoft
Software
Hardware
Network
Question : VB.NET: check last characters of a substring
Hi X-perts,
I need to check last four characters of a string like
If (Me.textbox1.Text.Substrin
g(Me.textb
ox1.Text.L
ength - 4, 4) = ".zip") Then
end if
The problem is that it generates an exception of its length < 4.
Is there a way of checking it without adding another outer if?
Thanks
Answer : VB.NET: check last characters of a substring
In the above code you should add this
Imports Microsoft.VisualBasic
or you can do something like:
1: 2: 3:
If Microsoft.VisualBasic.Right(Textbox1.text,4) = ".zip" then End If
Open in New Window
Select All
Random Solutions
SQL #Tmp tables
Program constantsly closes and has "encountered error report"
Add CrLf to a string of text
Silverlight bandwidth performance
Add reference to Microsoft.SqlServer.Manage<wbr />ment not available
internet browser bring up a white page.. no error..
" List does not exist" when start Sharepoint portal server page. Please kindly help me!
call / run / execute a javascript function on a html webpage with an vb 6 activeX on the same page
Raid 5 4x1 TB format time?
How to reference the "checked" value of a checkbox in a GridView template field