This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Find any text...

Old posts that have not been replied to for several years.
Locked
J
Jimbo

Post by Jimbo »

I have got a line of a text file and i am using [string range] to go through each character of it. However it is mostly spaces...is there any way to make it find *any* text.
E.g if {$srange == "anytxt"} {
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

hehe dunno but have you tried modifying it a bit?

if {$srange != ""} {

dunno if it'll work.... just a thought :wink:
Elen sila lúmenn' omentielvo
J
Jimbo

Post by Jimbo »

Cheers...thats a brilliant idea!!! I hadnt thought of that!
J
Jimbo

Post by Jimbo »

Ive just realised...that wont work. Is there any way to say whether it equals xx:xx
where x is anything?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Maybe you could be more clear what you're trying to do. Are you trying to get all the characters, except spaces? When you say "any text" does that include spaces? Are you trying to split up a file that has columns separated by spaces?

Instead of "string range" you might want to try the "split" command. Also, "string match" lets you do a wildcard search. Using "*" will match anything. You can also use "regexp" to do more complicated pattern matching.
J
Jimbo

Post by Jimbo »

Cheers m8...string match worked!
Locked