how to extract string lenght in an int java code example Example: string length in java String data = "Hello, World!"; int nameLength = data.length();