IT KNOWLEDGE

IT KNOWLEDGE
BC

Wednesday, May 21, 2014

How to remove a string(VB.Net)

Below is the code which to remove the string.

Dim Commune As String = "Chaom Choa"
        Dim District As String = "Porthisen Chey"
        Dim Province As String = "Phnom Penh"
        Dim Address As String
        Address = "I live in " & Commune & ",  " & District & ",  " & Province
        Address = Address.Remove(31, District.Length)
        MsgBox(Address)

In this sample, the message will show "I live in Chaom Choa, Phnom Penh"  because it removes district string"Porthisen Chey" from whole string.



Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: itech-9999

0 comments: