replace

 

 

Overview

The replace function replaces a specified number of characters in a Text or String with another Text or String. The replace function is non-destructive

Usage

The replace function replaces only the substring at the specified index. The replace function is similar to the substitute function, except that substitute can replace any or all of the occurrences of the specified substring whereas replace only replaces one at a specified position in the String.

 

Syntax


Expression:

(replace old-text start length new-text)


Arguments Name Type Description
Argument:old-textString or Text A String object or Text that contains the text to be replaced.
Argument:startInteger A positive integer indicating the position of the first character in old-text to be replaced. Set start to 0 for the first character, 1 for the second and so on
Argument:lengthInteger A positive integer representing the number of characters, after the starting position, to be replaced.
Argument:new-textString or Text The Text or String to be inserted in old-text at start, replacing the specified characters. new-text does not have to be the same length as length

Returns:

The result string after the replace has been done



 

Examples

Here are a number of links to Lambda coding examples which contain this instruction in various use cases.

 

Argument Types

Here are the links to the data types of the function arguments.

String Text Integer

Here are also a number of links to functions having arguments with any of these data types.

++ += + /=
/ *= * --
-= - addMethod addi
appendWriteln append avg badd
balance bdiv binaryInsert binaryNand
binaryNor binaryNot binaryNxor binarySearch
bitwiseAnd bitwiseNand bitwiseNor bitwiseNot
bitwiseNxor bitwiseOr bitwiseShiftLeft bitwiseShiftRight
bitwiseXor bmod bmul boolean
cadd cdiv char character
clean closeLog cmod cmul
code compareEQ compareGE compareGT
compareLE compareLT compareNE compare
comparison compress cons count
csub date day days360
debugBrowsableProcs debugDetective debugEval deleteRows
delete dimension disassemble display
divi downcase encode evalInSyncLocalContext
eval exit exportCsv exportSbf
exportTab fact fdisplay fileClose
fileCopy fileDir fileDisplay fileEraseDir
fileErase fileExists fileMakeDir fileOpen
fileReadAll fileReadRecord fileRead fileResize
fileSeek fileSizeOf fileWriteAll fileWrite
filewriteln findBlock find floor
fraction freeBlock gcd getRecursionCount
hashString hour iadd icompareEQ
icompareGE icompareGT icompareLE icompareLT
icompareNE idiv imod importCsv
importSbf importTab imul insertRows
insert inside inspect integer
isAtom isBitVector isBoolean isBound
isByteVector isCharAlphabetic isCharAlphanumeric isCharLowercase
isCharName isCharNumeric isCharUppercase isCharWhitespace
isChar isCharacter isComplex isDate
isDictionary isDirectory isEqual isError
isEven isFloatVector isIdentical isInside
isIntegerVector isInteger isLambda isMatrix
isMember isMoney isNumberMatrix isNumberVector
isNumber isObjectVector isObject isPair
isPcodeVector isString isStructure isSymbol
isText isType isVector isub
julian kurtosis lcm left
length list loadModule loadWorkspace
macroReplace makeQuotedList makeQuotedSymbol max
median member mid min
minute mod modi money
month muli new number
objectToMatrix objectToNumMatrix objectToNumVector offset
openLog pair parent parse
pointer preAllocateFixedMemoryBlocks product qt
random randomize range rank
refAttributes refValues ref remove
replace rept resize right
round run saveImmediate saveModule
saveObject saveRepository saveWorkspace second
setAttributes setBlock setCar setCdr
setLastCdr set setf setq
sizeof skew sort sql
sqrt srandom stdev stdevp
stringCiEQ stringCiGE stringCiGT stringCiLE
stringCiLT stringCiNE stringFill stringToBVector
stringToVector string subi submit
substitute substringCiEQ substringCiGE substringCiGT
substringCiLE substringCiLT substringCiNE substringEQ
substringFill substringGE substringGT substringLE
substringLT substringNE substring sum
sumsqr svmRegression symbolToTypeCode symbol
system text time trim
type uniqueInsert upcase var
varp vectorBinaryInnerProduct vectorBipolarInnerProduct vectorCosineInnerProduct
vectorCubeInnerProduct vectorDelete vectorExpInnerProduct vectorFill
vectorInnerProduct vectorLogInnerProduct vectorQuartInnerProduct vectorQuintInnerProduct
vectorSigmoidInnerProduct vectorSineInnerProduct vectorSquareInnerProduct vectorTanInnerProduct
vectorTanhInnerProduct writelg writeln year

Analytic Information Server (AIS)

AIS Component Systems

  • Smartbase Engine
  • QT C++ Libraries
  • MySQL Relational Database
  • AIS Lisp Libraries
  • Rapid Analytic Demo IDE