Top index Wirbel home

::replaced

string.replaced(string x, string y) - replace all occurrances of x with y in s
string.replaced(dict(string, string) dict) - replace in a string substrings found in a dictionary
string.replaced(list(tuple(string, string)) items) - replace in a string substrings with other substrings

string.replaced(string x, string y) replaces all occurrances of x in s by y. If x is empty then y will be inserted between each character of y. his method returns a new string and leaves s unchanged.

string.replaced(dict(string, string) dict) searches the string s for substrings that are keys in dict. That substrings are replaced by the according values from dict. Make sure that none of the keys in dict is empty.

string.replaced(list(tuple(string, string)) items) is called with a list of (s,r) pairs, where s is a search string and r a replacement for it. No search string may be empty.

See also

replace, replaced_tags