you can just use String( this == key)<br><br><div class="gmail_quote">On Wed, Mar 7, 2012 at 11:32 PM, shawn <span dir="ltr">&lt;<a href="mailto:youngxiao121@hotmail.com">youngxiao121@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I insert several strings into working memory to make a comparison. But how to<br>
compare a anonymous string to another string. code like:<br>
<br>
List &lt;String&gt; s = ArrayList &lt;String&gt;<br>
String key<br>
<br>
function void insertValue( s, KnowledgeHelper kh ) {<br>
<br>
        for( String string : s ) {<br>
                kh.insert( string );<br>
        }<br>
<br>
}<br>
...<br>
When<br>
        not $string : String( toString() == key)<br>
Then....<br>
Obviously, toString() can not do this task.<br>
How to get the string&#39;s value ?<br>
Cheers.<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Simple-question-about-String-comparison-in-Drool-tp3808352p3808352.html" target="_blank">http://drools.46999.n3.nabble.com/Simple-question-about-String-comparison-in-Drool-tp3808352p3808352.html</a><br>


Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br> - MyJourney @ <a href="http://salaboy.wordpress.com" target="_blank">http://salaboy.wordpress.com</a><div> - Co-Founder @ <a href="http://www.jugargentina.org" target="_blank">http://www.jugargentina.org</a><br>

 - Co-Founder @ <a href="http://www.jbug.com.ar" target="_blank">http://www.jbug.com.ar</a><br> <br> - Salatino &quot;Salaboy&quot; Mauricio -</div><br>