- 1
Is there a function for string difference? If yes, is it '-'?
Or strDifference? (Because there is strIntersection)
2 Respostas
+ 4
To compute 'differences' of string, you can use the standard module 'difflib':
<< The difflib module contains tools for computing and working with differences between sequences. It is especially useful for comparing text, and includes functions that produce reports using several common difference formats. >>
https://pymotw.com/2/difflib/
Then, you have many ways to update strings...
If you only want to 'substract' one string from another, the @Hatsy Rei link show some ways without use of difflib ;)