|
-
Oct 16th, 2010, 12:14 AM
#1
Thread Starter
Lively Member
Find a Words and delete them ?
HI
I make Text1 it contain this Words:
PHP Code:
IYAD OMAR Hassan Mustafa
ZYAD OMAR Hassan Mustafa
AHMED OMAR Hassan Mustafa
KHALED OMAR Hassan Mustafa
i need code to find (Mustafa and Omar & IYAD) and delete them ????
-
Oct 16th, 2010, 02:09 AM
#2
Re: Find a Words and delete them ?
vb Code:
Text1.Text = Replace(Text1.Text, "Mustafa", "", , , vbTextCompare)
Text1.Text = Replace(Text1.Text, "Omar", "", , , vbTextCompare)
Text1.Text = Replace(Text1.Text, "IYAD", "", , , vbTextCompare)
...
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Oct 16th, 2010, 02:19 AM
#3
Junior Member
Re: Find a Words and delete them ?
Code:
Dim S As String, RS As String
S = Text1.Text
RS = Replace(S, "Mustafa", vbNullString, , , vbTextCompare)
RS = Replace(RS, "Omar", vbNullString, , , vbTextCompare)
RS = Replace(RS, "IYAD", vbNullString, , , vbTextCompare)
'Removing any extra spaces (double spaces or more) that may be present after removing the sub strings
Do While InStr(RS, " ")
RS = Replace(RS, " ", " ")
Loop
'Removing any leading or trailing spaces that may be present after removing the sub strings
Text1.Text = Trim(RS)
If you only want to remove a specific casing of the word(s) just remove the , , , vbTextCompare
Last edited by Jackkkkk; Oct 16th, 2010 at 02:30 AM.
-
Oct 16th, 2010, 11:19 AM
#4
Thread Starter
Lively Member
Re: Find a Words and delete them ?
ThAnks You aLL
-
Oct 16th, 2010, 12:18 PM
#5
Re: Find a Words and delete them ?
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|