Free Support Forum - aspose.com

HOw Can I get Length of the Cell

Hi,
Is there any property which will give me the length of the cells.or how can i do this using Aspose

Thanks.

Hi,


Can you please elaborate your question little more? Do you need the number of Data Cells in a Worksheet or do you need the length of characters in a particular Cell?

Thank you

Thanks For replying.

I got the Solution for the same. I was trying to get length of character in the particular Cell.

cells.getCell(5,5).getValue().toString().length()

Can you suggset me how can i check wether the cell is Empty or Not…


Thanks.

Hi,

If cell’s string value’s length is 0, then the cell is empty. Please use this code.

Java


if (cl.getStringValue().length() == 0)
{

//cell is empty

}

Hi,


Also, you may try the below code as well

JAVA
if (cell.getValue() != null)
{
System.out.println(“true”);
}
else
{
System.out.println(“false”);
}