Dear friends,
I want to read a file, for instance, "testing.txt". Then, I need to put it in a text box. - Dim stExample As String
-
stExample = there is something on your right side.
I need to scan throught this sentence and replace "right" to "left", then the whole sentence will put into a text box.
Appreciate for any reply. Thank you.
Best Regards.
7 1769
Using your example (but you forgot your quotes!!) it would work like this: - Dim stExample As String
-
stExample = "there is something on your right side"
-
stExample = stExample.Replace("right", "left")
One of the easist ways to learn VB is to use the code editor to guide you. I.E. If you were to type stExample. you'd get a drop down menu (as soon as you typed the period ".") showing you all the operations you can do to the string, and most of the time they're pretty straight forward (replacing text uses the Replace function on the list).
Hope that helps you and good luck learning VB!
Adam
Dear friends,
I want to read a file, for instance, "testing.txt". Then, I need to put it in a text box. - Dim stExample As String
-
stExample = there is something on your right side.
I need to scan throught this sentence and replace "right" to "left", then the whole sentence will put into a text box.
Appreciate for any reply. Thank you.
Best Regards.
Which version of vb are you using?
Which version of vb are you using?
VB6. By the way, its not working, it showed complie error : method or data member not found.
Do I need to enable any component?
Best Regards.
VB6. By the way, its not working, it showed complie error : method or data member not found.
Do I need to enable any component?
Best Regards.
No. The advice you were given is for vb.net and will not work for you. That is why I asked you which version you are using.
So are you asking how to open a text file in vb6?
Also are you asking how to find and replace a word in that text file?
Finally are you asking how to put that altered text into a textbox on a form?
No. The advice you were given is for vb.net and will not work for you. That is why I asked you which version you are using.
So are you asking how to open a text file in vb6?
Also are you asking how to find and replace a word in that text file?
Finally are you asking how to put that altered text into a textbox on a form?
Thanks for the reply. Well, yes, you are right. That's what I really need, especially the part of "replace". I only can use VB6 to do it, and of course, I know nothing about VB.net. haha^^
Best Regards.
Thanks for the reply. Well, yes, you are right. That's what I really need, especially the part of "replace". I only can use VB6 to do it, and of course, I know nothing about VB.net. haha^^
Best Regards.
In your vb6 help, look up 'Replace function'
In your vb6 help, look up 'Replace function'
-
Dim str1 as String
-
str1 = Replace(Original, tobeReplaced, Replacement)
Thanks, it works. Thats the answer.
Best Regards.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Pikkel |
last post by:
i'm looking for a way to replace special characters with characters
without accents, cedilles, etc.
|
by: yearTiger2002 |
last post by:
Our company's back end database server does not handle french
accentuated characters well. We need to replace those characters with
english letters when validating the form inputs. Any suggestions?...
|
by: Frank.Sebesta |
last post by:
I have a wedge mag stripe reader that I swipe when ask to input
information in a query.
How do I filter the unwanted characters.
Apparently there are two mag stripes that are read every time I...
|
by: bobbie.matera |
last post by:
I have the system setup to import a DomainList.csv file into a table
called tblDmnLst. It contains a column called "NitchMarket" (datatype
= text 75 character) where the user has discribed the...
|
by: David Beck |
last post by:
I donwnload some files for processing every day that have unwanted
characters in them. In VB6 I use the InputB to read in the text and the
StrConv.
vLinesFromFile =...
|
by: et |
last post by:
How can I strip out unwanted characters in a string before updating the
database? For instance, in names & addresses in our client table, we want
only letters and numbers, no punctuation. Is...
|
by: Chris Brat |
last post by:
Hi,
Is there a better way to replace/remove characters (specifically ' and
" characters in my case, but it could be anything) in strings in a
list, than this example to replace 'a' with 'b':
...
|
by: vvenk |
last post by:
Hello:
I have a string, "Testing_!@#$%^&*()". It may have single and double
quotations as well.
I would like to strip all chararcters others than a-z, A-Z, 0-9 and the comma.
I came across...
|
by: cmdolcet69 |
last post by:
I have a value bieng added into my array that displays correctly in
the textbox as 0.10 however when i read from my array into an excel
spreadsheet I get the value 0.10 how can I get rid of the ...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| | |