EndsWith method. : String Find « Data Type « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » Data Type » String Find 
2.33.9.EndsWith method.
Imports System

Public Class EndsWithTest

    Public Shared Sub Main()
        Dim strSource As String() "<b>This is bold text</b>","wrong>"}

        Dim As String
        For Each s In  strSource
            Console.WriteLine(StripEndTags(s))
        Next s
    End Sub
    Private Shared Function StripEndTags(item As StringAs String
        If item.Trim().EndsWith(">"Then
            Dim lastLocation As Integer = item.LastIndexOf("</")
            If lastLocation >= Then
                item = item.Substring(0, lastLocation)
            End If
        End If
    Return Item
    End Function
End Class
2.33.String Find
2.33.1.Demonstrating StartsWith and EndsWith methods
2.33.2.Return the index of the string
2.33.3.Use IndexOf to locate a substring in a string
2.33.4.Use LastIndexOf to find a substring in a string
2.33.5.Use IndexOfAny to find first occurrence of character in array
2.33.6.Use LastIndexOfAny to find first occurrence of character in array
2.33.7.String Index of any
2.33.8.Use the LastIndexOf(Char) method to find the last directory separator character in a string
2.33.9.EndsWith method.
2.33.10.Find the index of the last occurrence of any character in the string "is" within another string.
2.33.11.IsMatch(String) determines whether a string is a valid to Regular expression
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.