Do

B.equals(Caption) and not using == operator. When you use the == operator on 
Strings you are comparing the Strings starting address in memory, ie the 
address in memory of the first letter in the string.

On Jan 9, 2013, at 10:26, "sars84" <[email protected]> wrote:

> Hallo All,
>
> Is a Text from a Cell not equal to a String? I mean, I have;
>
> String G = cell.getRichStringCellValue().getString();  // Output :Caption
>
> or
>
> String B = cell.getStringCellValue(); // Output:Caption
>
> but wenn I do ;
>
> String Caption = "Caption";
> if (G == Caption){System.out.println("OK");}
> if (B == Caption){System.out.println("OK");}
>
> it doesn't work?
> How can i match a String with the Value (a String Value) from a Cell?
>
> Thanks in advance
> Sars
>
>
>
>
>
> --
> View this message in context: 
> http://apache-poi.1045710.n5.nabble.com/How-to-get-the-CellValue-from-a-Cell-as-String-tp5711810.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

This communication, including any attachments, may contain information that is 
proprietary, privileged, confidential or legally exempt from disclosure. If you 
are not a named addressee, you are hereby notified that you are not authorized 
to read, print, retain a copy of or disseminate any portion of this 
communication without the consent of the sender and that doing so may be 
unlawful. If you have received this communication in error, please immediately 
notify the sender via return e-mail and delete it from your system.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to