Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

syntax for replace

Posted on 2006-10-19
3
Medium Priority
?
400 Views
Last Modified: 2008-03-04
can any one send me the piece of quote for the syntax
for replace one variable value entered into VB,its value should be stored

ie "Replace" method should be used i guess

i need the syntax

thanks
0
Comment
Question by:Prakashv20
  • 2
3 Comments
 
LVL 54

Expert Comment

by:Ryan Chong
ID: 17770995
Replace(expression, find, replacewith[, start[, count[, compare]]])

Check this out:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/65e15b2c-99b6-4f82-88e7-8c657489dd34.asp
0
 
LVL 11

Accepted Solution

by:
ch2 earned 750 total points
ID: 17771002
Private Sub Form_Load()

    Dim Original As String
    Dim Search As String
    Dim Add As String
    Dim Replaced As String
   
    Original = "My dog eats apples"
    Search = "apples"
    Add = "mushrooms"
   
    Replaced = Original & Chr(13) & Replace(Original, Search, Add, 1, -1, vbTextCompare)
   
    MsgBox (Replaced)

End Sub
0
 
LVL 54

Expert Comment

by:Ryan Chong
ID: 17771007
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question