Try to work hard !

Replace Function - Visual Basic 6.0 (VB 6.0)

Returns a string in which a specified substring has been replaced with another substring a specified number of times.
Syntax:
Replace(expression, find, replace[, start[, count[, compare]]])
ParameterDescription
expressionRequired. String expression containing substring to replace.
findRequired. Substring being searched for.
replaceRequired. Replacement substring.
startOptional. Default 1. Position within expression where substring search is to begin.
countOptional. Default -1 (All). Number of substring substitutions to perform.
compareOptional. Default vbBinaryCompare (0). Numeric value indicating the kind of comparison to use when evaluating substrings.

Return Data type:
String
Example:

Dim St as String
St = "Chennaiiq"


StatementResultRemark
Replace(St, "n", "m")Chemmaiiq 
Replace(St, "N", "m")Chennaiiq 
Replace(St, "n", "M")CheMMaiiq 
Replace(St, "n", "m", 5)maiiq 
Replace(St, "n", "m", 4, 1)mnaiiq 
Replace("", "n", "m") Empty String
Replace(null, "n", "m")ErrorInvalid use of null
Replace(St, "", "m")Chennaiiq(Copy of Expression)
Replace(St, "n", "")Cheaiiq 
Replace(St, "n", "m", 20) Empty String
Replace(St, "n", "m", 1, 0)Chennaiiq 


'Knowledge > Visual Basic 6+' 카테고리의 다른 글

VB6 단축키  (0) 2018.04.19
[VB6] 전역변수 선언 (Not Global keyword)  (0) 2018.04.02
[VB6] Replace Function - Visual Basic 6.0  (0) 2018.04.02
Visual Basic 문법  (0) 2018.03.27
[VB6] What is Me.Caption  (0) 2018.03.26
For...Next Statement (Visual Basic)  (0) 2018.03.13

Comment +0