get string length by pointer