StringFunctions.ReplaceWord

Performs a replace on whole words, rather than substrings. This is similar to WordStrTran in SQ.VFP, except this version doesn't account for having non-word characters as the first or last character in oldvalue. So, for example, if you want to replace "tablename" in "tablename.fieldname", call this with "tablename" as the oldvalue, rather than "tablename."

public static string ReplaceWord(string replacein,
	string oldvalue,
	string newvalue)

Return Value

A string with each occurence of oldvalue (as a complete word) replaced with newvalue

Parameters

replacein The string to do the replacement on

oldvalue The value to find

newvalue The value to replace oldvalue with


See also:

Class StringFunctions

© Stonefield Software Inc., 2019 • Updated: 02/12/16
Comment or report problem with topic