![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
.NET Ninja - python newb
Join Date: Apr 2008
Posts: 9
Rep Power: 0
![]() |
Help with strings
Ok so I am trying to created a app that will loop through a folder and delete files with names that contains key words (ie: 'copy'). I have done some research and tried a few things but cant quite get it to work. Is there a way to check if 'copy' is in a string. Like a .contains() or something. Thanks for your help
__________________
The way programmers percive beauty is intimately related to their ability to process and understand complexity. |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
Re: Help with strings
indeed there is
Python Syntax (Toggle Plain Text)
What will be printed out is there position of the first character of the substring "there". Hope this help, Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
|
|
#3 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,722
Rep Power: 5
![]() |
Re: Help with strings
It gets even simpler than that. You can use the "in" operator to test for the occurrence of a string within another string. For example, the following program will search for the string "quey" within every file inside all directories and subdirectories of "fdir".
Python Syntax (Toggle Plain Text)
|
|
|
|
|
|
#4 |
|
.NET Ninja - python newb
Join Date: Apr 2008
Posts: 9
Rep Power: 0
![]() |
Re: Help with strings
SWEET.... You all are gods!! and I am a newb.... lol
__________________
The way programmers percive beauty is intimately related to their ability to process and understand complexity. |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
|
Re: Help with strings
Gods, nah God yes (Sane) fool who likes to think he knows something about programming (me) lol.
Glad everything is working for you, if it is of course Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
|
|
#6 |
|
.NET Ninja - python newb
Join Date: Apr 2008
Posts: 9
Rep Power: 0
![]() |
Re: Help with strings
Yeah.. I am a .net guru but falling head over heals for linux. PHP and python are awsome.
__________________
The way programmers percive beauty is intimately related to their ability to process and understand complexity. |
|
|
|
|
|
#7 |
|
Hobbyist Programmer
|
Re: Help with strings
Personally unfortunatley i know little of any language, i just know some Python, C++, Java, VB.NET, PHP, JavaScript. But i kinda enjoy knowing a little in each, i hope to be able to gain a better understanding in one area though.
As well as do alot of work on algorithms its just finding time inbetween college, hopefull i'll be able to build on things when i reach uni in a specialized language most likely Java. Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
|
|
#8 |
|
.NET Ninja - python newb
Join Date: Apr 2008
Posts: 9
Rep Power: 0
![]() |
Re: Help with strings
well sounds like you have a good start. Just keep up the learning and it will be great. I recommend also learning MySQL
__________________
The way programmers percive beauty is intimately related to their ability to process and understand complexity. |
|
|
|
|
|
#9 |
|
Hobbyist Programmer
|
Re: Help with strings
Indeed i do need to look into SQL not just specifically for MySQL but for all database software, once again though it is finding time. I use to know the basics of it when i first began to look into PHP in detail but since then i have lost track of it due to the fact i don't use PHP all that often and what little i did got pussed aside for GCSE exams and then college
thanks for the tip though Chris
__________________
Who said i couldn't program sarcasm = raw_input('Type in a sarcastic remark: ')
|
|
|
|
|
|
#10 |
|
.NET Ninja - python newb
Join Date: Apr 2008
Posts: 9
Rep Power: 0
![]() |
Re: Help with strings
yeah... I know MSSQL but its not a free solution. You can pretty much get the gist with MySQL. I am wanting to learn how to access a MySQL database via python. I have some ideas for cracking the md5 ecryption. I know that I will prob never crack it but hey, it might be fun to give it a shot.
__________________
The way programmers percive beauty is intimately related to their ability to process and understand complexity. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The immutability of strings | Arla | C# | 5 | Apr 8th, 2008 1:58 PM |
| Splitting strings into other strings | Keiro | C | 2 | Dec 11th, 2006 6:10 AM |
| inserting strings into other strings | codylee270 | C | 2 | Dec 3rd, 2005 9:37 PM |
| Question about multidimensional arrays of strings | aznluvsmc | C | 8 | Oct 15th, 2005 10:20 PM |
| pointers strings, and strcat() | conbrio | C | 3 | Apr 16th, 2005 1:23 PM |