is it possible to check if a string contains a certain part?
example
the string = ''blueredpurple''
i want to see if the string contains ''red''
string
- Feralidragon
- Godlike
- Posts: 5493
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: string
^ What anth said.
I must note however that the code above only makes case-sensitive matches, so it matches "red" but it does not match "RED" for example.
If you want to make it case-insensitive:
I must note however that the code above only makes case-sensitive matches, so it matches "red" but it does not match "RED" for example.
If you want to make it case-insensitive:
Code: Select all
if (InStr(Caps(someStr), Caps("red")) != -1)
Re: string
thnx guys
if i want to see if a certain part is not in the string, I replace the != with ==?
if i want to see if a certain part is not in the string, I replace the != with ==?
Re: string
Yep
Website, Forum & UTStats
******************************************************************************
Nexgen Server Controller || My plugins & mods on GitHub
******************************************************************************
******************************************************************************
Nexgen Server Controller || My plugins & mods on GitHub
******************************************************************************