Best way to get a certain token and onwards

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Best way to get a certain token and onwards

Post by tiago »

Please,
how do I get "New Lap Record this Sunday.Must see.flv" out of "Racing.com.New Lap Record this Sunday.Must see.flv"?

Related wish:
- Gettoken should be given a way to return everything that's ahead of it regardless of being other tokens or not.
Power-hungry user!!!

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Best way to get a certain token and onwards

Post by serendipity »

tiago wrote:Please,
how do I get "New Lap Record this Sunday.Must see.flv" out of "Racing.com.New Lap Record this Sunday.Must see.flv"?

Related wish:
- Gettoken should be given a way to return everything that's ahead of it regardless of being other tokens or not.

Code: Select all

text gettoken("Racing.com.New Lap Record this Sunday.Must see.flv", 2, "Racing.com.");

tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Re: Best way to get a certain token and onwards

Post by tiago »

serendipity wrote:
tiago wrote:Please,
how do I get "New Lap Record this Sunday.Must see.flv" out of "Racing.com.New Lap Record this Sunday.Must see.flv"?

Related wish:
- Gettoken should be given a way to return everything that's ahead of it regardless of being other tokens or not.

Code: Select all

text gettoken("Racing.com.New Lap Record this Sunday.Must see.flv", 2, "Racing.com.");
Thanks but this will be limited to know separators, right?
I may think on a solution for this but thanks for trying, serendipity.
Power-hungry user!!!

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Best way to get a certain token and onwards

Post by Stefan »

tiago wrote:Thanks but this will be limited to know separators, right?
As always. You have to tell the program what you want.
Which is the common pattern to split? Every time the first period/hyphen/space/....? At an specific word? Specific length/pos?






.

PeterH
Posts: 2829
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Best way to get a certain token and onwards

Post by PeterH »

tiago wrote:Please,
how do I get "New Lap Record this Sunday.Must see.flv" out of "Racing.com.New Lap Record this Sunday.Must see.flv"?

Related wish:
- Gettoken should be given a way to return everything that's ahead of it regardless of being other tokens or not.
Sorry to say: I don't exactly understand the rules for what you want :?

I'd guess you want to see the source string as "."-delimited tokens, and want to get token 3 to 5? Or token 3 up to the end?

Months ago I had a request for this: expand gettoken() (or subtoken() or something like that) to allow specification of the number of tokens to return - analog to substr(). Don wasn't interested...

admin
Site Admin
Posts: 66366
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Best way to get a certain token and onwards

Post by admin »

Wish makes sense. Added.

tiago
Posts: 589
Joined: 14 Feb 2011 21:41

Re: Best way to get a certain token and onwards

Post by tiago »

Thanks for implementing it, it's saving my skin on several tasks.

By thw way great enhancement the "Highlight Path" feature.
Power-hungry user!!!

Post Reply