Hans,
This method isn't necessary. There is a UEL function that does the same thing: http://api.ofbiz.org/org/ofbiz/base/util/string/UelFunctions.html See str:replcate() -Adrian [hidden email] wrote: > Author: hansbak > Date: Thu Jun 11 02:14:32 2009 > New Revision: 783603 > > URL: http://svn.apache.org/viewvc?rev=783603&view=rev > Log: > make the party viewprofile request also working when only an emailaddress or telephone number is provided. usefull when this url is called from other webbased systems. > Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java?rev=783603&r1=783602&r2=783603&view=diff > ============================================================================== > --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java (original) > +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java Thu Jun 11 02:14:32 2009 > @@ -35,4 +35,17 @@ > } > return new BigDecimal(bigDecimalString); > } > + > + /** > + * > + * to be used in minilanguage to remove all occurrencies of removeString from inputString > + * > + * @param inputString > + * @param removeString > + * @return > + */ > + public static String removeStringFromString(String inputString, String removeString) { > + return(inputString.replaceAll(removeString, "")); > + } > + > } > > > |
Oops, keyboard malfunction. See str:replace().
-Adrian Adrian Crum wrote: > Hans, > > This method isn't necessary. There is a UEL function that does the same > thing: > > http://api.ofbiz.org/org/ofbiz/base/util/string/UelFunctions.html > > See str:replcate() > > -Adrian > > > [hidden email] wrote: >> Author: hansbak >> Date: Thu Jun 11 02:14:32 2009 >> New Revision: 783603 >> >> URL: http://svn.apache.org/viewvc?rev=783603&view=rev >> Log: >> make the party viewprofile request also working when only an >> emailaddress or telephone number is provided. usefull when this url is >> called from other webbased systems. >> Modified: >> ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java >> URL: >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java?rev=783603&r1=783602&r2=783603&view=diff >> >> ============================================================================== >> >> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java >> (original) >> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java >> Thu Jun 11 02:14:32 2009 >> @@ -35,4 +35,17 @@ >> } >> return new BigDecimal(bigDecimalString); >> } >> + >> + /** >> + * + * to be used in minilanguage to remove all occurrencies >> of removeString from inputString >> + * + * @param inputString >> + * @param removeString >> + * @return >> + */ >> + public static String removeStringFromString(String inputString, >> String removeString) { >> + return(inputString.replaceAll(removeString, "")); >> + } >> + >> } >> >> >> > |
In reply to this post by Adrian Crum
Adrian Crum wrote:
> Hans, >> ============================================================================== >> >> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java >> (original) >> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java >> Thu Jun 11 02:14:32 2009 >> @@ -35,4 +35,17 @@ >> } >> return new BigDecimal(bigDecimalString); >> } >> + >> + /** >> + * + * to be used in minilanguage to remove all occurrencies >> of removeString from inputString >> + * + * @param inputString >> + * @param removeString >> + * @return >> + */ >> + public static String removeStringFromString(String inputString, >> String removeString) { >> + return(inputString.replaceAll(removeString, "")); >> + } >> + Please follow ofbiz code formatting guidelines. Remove the () around the expression(not needed), and put a space after return. |
In reply to this post by Adrian Crum
good point Adrian, revised in revision 784399.
Regards, Hans On Thu, 2009-06-11 at 08:07 -0700, Adrian Crum wrote: > Oops, keyboard malfunction. See str:replace(). > > -Adrian > > Adrian Crum wrote: > > Hans, > > > > This method isn't necessary. There is a UEL function that does the same > > thing: > > > > http://api.ofbiz.org/org/ofbiz/base/util/string/UelFunctions.html > > > > See str:replcate() > > > > -Adrian > > > > > > [hidden email] wrote: > >> Author: hansbak > >> Date: Thu Jun 11 02:14:32 2009 > >> New Revision: 783603 > >> > >> URL: http://svn.apache.org/viewvc?rev=783603&view=rev > >> Log: > >> make the party viewprofile request also working when only an > >> emailaddress or telephone number is provided. usefull when this url is > >> called from other webbased systems. > >> Modified: > >> ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java > >> URL: > >> http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java?rev=783603&r1=783602&r2=783603&view=diff > >> > >> ============================================================================== > >> > >> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java > >> (original) > >> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilParse.java > >> Thu Jun 11 02:14:32 2009 > >> @@ -35,4 +35,17 @@ > >> } > >> return new BigDecimal(bigDecimalString); > >> } > >> + > >> + /** > >> + * + * to be used in minilanguage to remove all occurrencies > >> of removeString from inputString > >> + * + * @param inputString > >> + * @param removeString > >> + * @return > >> + */ > >> + public static String removeStringFromString(String inputString, > >> String removeString) { > >> + return(inputString.replaceAll(removeString, "")); > >> + } > >> + > >> } > >> > >> > >> > > Antwebsystems.com: Quality OFBiz services for competitive rates |
Free forum by Nabble | Edit this page |