| | |
Like function in Python
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Apr 2008
Posts: 2
Reputation:
Solved Threads: 0
Is there something similar to a LIKE function in python? What I'm trying to accomplish is to search inside a string, if it finds specific criteria it sets another variable to a specific value.
In other scripting languages I have used a LIKE function to do this but I can't find anything comparable in Python.
In other scripting languages I have used a LIKE function to do this but I can't find anything comparable in Python.
python Syntax (Toggle Plain Text)
>>> string = "A simple example string." >>> if 'example' in string: print 'the word \'%s\' is in: "%s"' % ('example', string) the word 'example' is in: "A simple example string." >>>
![]() |
Similar Threads
- Operating System in Python (Python)
- Python and shell commands (Python)
- Python and C (Python)
- python extending with c(doubts) (Python)
- writing swap function in Python (Python)
- Calling c function from python (Python)
- What is Lambda in Python (Python)
- Function that creates random changes in a string?? (Python)
Other Threads in the Python Forum
- Previous Thread: Text to Audio
- Next Thread: Simple code is confusing me
| Thread Tools | Search this Thread |
Tag cloud for Python
abrupt ansi anti approximation assignment avogadro backend basic beginner binary bluetooth calculator character code customdialog decimals dictionaries dictionary drive dynamic examples excel exe file float format ftp function gnu graphics gui heads homework http ideas import input java launcher leftmouse line linux list lists loop module mouse number numbers output parsing path pointer port prime program programming progressbar projects py2exe pygame pyqt python random recursion recursive refresh schedule scrolledtext sqlite ssh statistics stdout string strings sudokusolver sum table terminal text thread threading time tkinter tlapse tricks tuple tutorial twoup ubuntu unicode update urllib urllib2 variable wikipedia windows write wxpython xlib






