Forum Stats

  • 3,837,399 Users
  • 2,262,255 Discussions
  • 7,900,269 Comments

Discussions

String

user1254328
user1254328 Member Posts: 856 Bronze Badge

Hello -

we have a web form where user might put a in textfield       *testing     OR      testing*   and   click Submit.

on our bean side we will   get    the   submitted value   either   *testing    OR   testing*

what we want to achieve on bean side is  :

1> check  whether the value has   a     *   in it    ?

2> If there is a star then replace that   *   by   %

in short    *testing   becomes      %testing

and    testing*    will   become      testing%

what is the best / efficient way to achieve this ?

Thanks.