Re: Evaluating a string of text and looking for specific characters

Guo Du <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
On Mon, Dec 21, 2009 at 2:08 AM, biffjo <[email protected]> wrote:
>
> hello @funkhauser, I am going to see the #phillies this year.
>
> What I need to do is 'loop' through the string and when it hits on an '@' or
> '#' symbol, I need to make that part of the string a link. Anyone have a
> suggestion on the best way to do this?
Even it's possible using  string buildin split function (
http://freemarker.org/docs/ref_builtins_string.html#ref_builtin_split)
to search the @# and generate links, but I would suggest you write a
custom directive
(http://freemarker.org/docs/dgui_misc_userdefdir.html) to search the
special chars and generate links. You could using regex to search
chars and do the trick, it's much easier :) e.g.
<@twitter>
hello @funkhauser, I am going to see the #phillies this year.
</@twitter>

-Guo

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.