String.replace#

usencrypt.cipher.String.replace(self, a, b, count=- 1)#

Returns a copy of the encrypted string \(E(x)\) with a specified character replaced by another specified character.

Parameters
  • a (usencrypt.cipher.Char) – The character to be replaced.

  • b (usencrypt.cipher.Char) – The character to replace the original with.

  • count (int) – The number of a occurances to replace. Defaults to -1, which replaces all occurances.

Returns

The original string with a characters replaced by b characters.

Return type

usencrypt.cipher.String

Examples
>>> import usencrypt as ue
>>> test = ue.encrypt("Testing*Testing*1*2*3")
>>> test = test.replace('*', ' ')
>>> test
"Testing Testing 1 2 3"