Find out the length

Report a typo

Arrange the code so that if the user sends a text frame, the server first thanks the user, then saves the message in a variable and sends back its length.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                send(Frame.Text("Thank you for the message!"))
              
                for (frame in incoming) {
              
                val receivedText = frame.readText()
              
                }
              
                frame as? Frame.Text ?: continue
              
                send(Frame.Text("Length of your word is ${receivedText.length}"))
              
___

Create a free account to access the full topic