Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Truncating a string

Status
Not open for further replies.

Winstonb

Technical User
Aug 11, 2001
29
0
0
GB
Does anyone know how to do this in python ?

var = testing(123)(234)

I want to print out only "testing" by truncating var.

I would imagine that this could possibly be done by splitting "testing(123)(234)" into multiple fields using ( as the delimitter, and then printing out only the first field. Just don't know how in Python.

Thanks in advance
Winston
 
Thanks a lot KMarris

That worked a treat.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top