What use of string module?

Laura Creighton lac at openend.se
Tue Jun 2 05:39:29 EDT 2015


In a message of Mon, 01 Jun 2015 19:14:18 -0700, fl writes:
>Hi,
>
>I read the online help about string. It lists string constants, string 
>formatting, template strings and string functions. After reading these,
>I am still puzzled about how to use the string module. 
>
>Could you show me a few example about this module?
>
>Thanks

A long time ago, strings didn't have the methods they had now.
So the string module was created, so that people could all have
a common way to do some really common things that people like
to do with strings.  Now the strings have object methods to
do the same thing, so you don't really want to use it.

It's there for backwards compatibility.  You don't want all the
code that exists out there and uses it to all stop working one
day because we now have a better way to do it. :)

Laura



More information about the Python-list mailing list