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 Chriss Miller 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
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top