Python Forum

Full Version: string manipulation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have a string like so: string = "27.116.56.0 27.116.59.255 43.230.209.0 43.230.209.255"

how would you go from it to this format: string = "27.116.56.0-27.116.59.255,43.230.209.0-43.230.209.255"

any easy way doing that?

thanks,
Joe
That is in every beginner's tutorial like https://www.pythonforbeginners.com/conca...-in-python Also see the tutorials at Python's wiki https://wiki.python.org/moin/BeginnersGuide/Programmers
It will be more helpful with an example..

the problem is bigger then this two ranges..
Post an example and we will help you with any problems.