Re: string handle problem
- From: "slebetman@xxxxxxxxx" <slebetman@xxxxxxxxx>
- Date: 28 Nov 2005 19:58:07 -0800
MH wrote:
> In article <1133231209.671223.49750@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
> Hans <hansyin@xxxxxxxxx> wrote:
> >Hi, I encountered a string handle problem and need help.
> >In my code, I have a string which value could be "a1/a2" or "a2/a3/a4"
> >or "a2/b3/c3/a5", now I hope to get the last sub_string after "/", for
> >"a1/a2", I need "a2", for "a2/a3/a4" , I need "a4", and for
> >"a2/b3/c3/a5", I need a5.
> >
> >I knew I can use split command and then handle the list to get the last
> >one, but it seems a little complex, Is there an easy way to get it?
> >I'm thinking to use regexp, but regexp handle string in order from left
> >to right by default, I don't know how to change it to 'from right to
> >left'.
> >
> >Thanks a lot.
>
>
> What platform are you on? This MIGHT be doable using the [file tail]
> command, or some other variant of file..
>
I think it should work regardless of platform. Remember that Tcl
normalises file paths to slashes on all platforms.
.
- Follow-Ups:
- Re: string handle problem
- From: MH
- Re: string handle problem
- From: Bryan Oakley
- Re: string handle problem
- References:
- string handle problem
- From: Hans
- Re: string handle problem
- From: MH
- string handle problem
- Prev by Date: Expect timeout problem. I needs help.
- Next by Date: text widget: drag and drop
- Previous by thread: Re: string handle problem
- Next by thread: Re: string handle problem
- Index(es):
Relevant Pages
|