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
Merge two pdf documents using Ghostscript
Access 2003 Macro Question: How to set focus to a specific tab on a tab control within an existing macro?
Receiving error when submitting data to SQL Server through asp.net vb
Need to update first booking of the day for each person within a time period
How to create a Second Global Address List in exchange 2007
Input masks for numerical data?
Reader.GetString Receives Conversion Error in vb.net
Auto-updating a view-based subform
Exporting Access Report as PDF with a unique name
Break Links in Excel?