ReplaceKnown is like ReplaceAll but only replaces placeholders that are known (recognized). Unrecognized placeholders will remain in the output.
(input, empty string)
| 152 | // placeholders that are known (recognized). Unrecognized |
| 153 | // placeholders will remain in the output. |
| 154 | func (r *Replacer) ReplaceKnown(input, empty string) string { |
| 155 | out, _ := r.replace(input, empty, false, false, false, nil) |
| 156 | return out |
| 157 | } |
| 158 | |
| 159 | // ReplaceAll efficiently replaces placeholders in input with |
| 160 | // their values. All placeholders are replaced in the output |