+92 332 4229 857 99ProjectIdeas@Gmail.com

String.Remove function (Vb.net)


String Remove function
String.Remove() function removes specified number of characters from the string. This function has two overloads:
First: takes a starting index after which all the string is removed.
Second: takes a starting index and length of number of characters to be removed.
Example1 demonstrates first overload and Example2 demonstrates the second overload.
System.String is the library for this function.
 
Example1
Dim str1 As String = "Microsoft"
MsgBox(str1.Remove(2))
Result
The message box will display "Mi".

Example2
Dim str1 As String = "Microsoft"
MsgBox(str1.Remove(2, 4))
Result
The message box will display "Mioft".


Related articles

0 comments: