In str.replace(old, new[, count],what is the use of count?,how to use count

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sandeep neerudu

    In str.replace(old, new[, count],what is the use of count?,how to use count

    In str.replace(old , new[, count],what is the use of count?,how to use count
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    As described in the Python documentation:
    Return a copy of the string with all occurrences of substring old replaced by new. If the optional argument count is given, only the first count occurrences are replaced.
    P.S.
    Google is your friend!

    Comment

    Working...