Regsub Usage
Replaces a value with a given value
Syntax:
regsub “<actual value in the string>” $string
“<value to replace>” <newString>
Example:
set string "My name is Kavitha"
regsub "Kavitha" $string "Mythri" name2
puts "$name2"
Output
My name is Mythri
Output
My name is Mythri
Nice explaination .. Also can you tell about how to do same if i want to replace string in file
ReplyDelete