How to replace the special character $owner with \"hr\" and $table_name with \"hr\" and $constraint_name with \"scma_constraint\" in dynamic. Change
\"alter ta
If you want to replace all matches, then use replaceAll()
method and you need to escape special characters like dollar because replaceAll()
gets a regex as first parameter and if you write "$owner"
it will mean that your string must start with "owner"
.
myString.replaceAll("\\$owner", "hr")
.replaceAll("\\$table_name", "hr")
.replaceAll("\\$constraint_name", "scma_constraint" );