Information Retrieval Second Lecture VB NET String Class
Information Retrieval Second Lecture VB. NET String Class
VB. NET String Class 1. 2. 3. 4. 5. 6. 7. 8. 9. VB. NET String. Length() VB. NET String. Insert() VB. NET String. Index. Of() VB. NET String. Contains() VB. NET String. Compare() VB. NET String. substring() VB. NET String. Equals() VB. NET String. Split() VB. NET String. Concat()
String. Length()
Example 1 Display each character in a sentence in a List box
Example 1
Example 1
Example 1 Or Text. Box 2. Text = Convert. To. String(Text. Box 1. Text. Length)
String. Insert
Example 2 Insert second word in appropriate place in first word
Example 2
Example 2
Example 2
Try (. To. Lower , . To. Upper)
String. Index. Of
String. Index. Of
String. Contains
String. Contains
String. Compare
String. Compare
String. Substring
String. Substring
String. Equals
String. Equals
String. Spilt
Example 2
Example 2
String. Concat
String. Concat
String. Concat
Reverse a String
Reverse a String
Count the occurrences of words in a String
Question 1 Count how many times a string occurs in paragraph
Question 1
http: //www. visual-basic-tutorials. com/get-the-next-word-after-a -specific-word-in-visual-basic. htm • Get or Return the Next Word after a Specific Word Private Sub Button 1_Click(sender As Object, e As Event. Args) Handles Button 1. Click Dim str As String = Text. Box 1. Text Msg. Box("the word after " & str & " is: " & Text. Box 2. Text. Substring(Text. Box 2. Text. Index. Of(str) + Val(str. Length + 1)). Split(" ")(0), Msg. Box. Style. Information) End Sub
- Slides: 37