MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: substrings at the end of words


Hello
the magic word EndOfString will do the trick.

a = {"edit", "listed", "called", "wedding"}
StringCases[a, _ ~~ "ed" ~~ EndOfString]

{{}, {ted}, {led}, {}}

Sincerely, Daniel

fartous at mail15.com wrote:
> a = {"edit", "listed", "called", "wedding"}
> StringCases[a, _ ~~ "ed"]
> Out[]= {{}, {ted}, {led}, {wed}}
> i want to extract only the "ed" string which located only at the end of the 
> words, i could not do that using the above code.
> thanks
> jack
> 


  • Prev by Date: Re: coloring only some substring
  • Next by Date: Re: substrings at the end of words
  • Previous by thread: Re: substrings at the end of words
  • Next by thread: Re: substrings at the end of words