Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

String

user1254328Apr 17 2019

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.

Comments
Post Details
Added on Apr 17 2019
0 comments
117 views