If you have variable that a string with that whole declaration in it, it's variable.length().
If you need the length of the pieces, it's fileNamex.length() and tfileName.length().
That looks more like a piece lopped out of a program in some other language. If that's the case, you use the functions in that language, not Java.