[rules-users] Removing Special Characters

kachaps4u kachanAnidharan at gmail.com
Tue Jan 3 08:26:01 EST 2012


I think you can also do this(See Below). You need the customer name length
right? Please correct me if I am wrong. Thank you.


rule "Wild Character validation" 
  when 
    c : CustomerInfo(n:customerName != ""); 

  then 

   int l = n.length(); 
   int ch = 0; 
   int i = 0; 
   for (i = 0; i < l; i++) { 
      if (data.charAt(i) != "*"|| data.charAt(i) != "#"){ 
         continue; 
        } 
        ch++; 
        data.setCharAt(i, ""); 
      } 
   c.setCustomerName(data); 
end 

--
View this message in context: http://drools.46999.n3.nabble.com/Removing-Special-Characters-tp3628821p3629005.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list