DEV Community

Cover image for BigBrainKotlin#3 | Spin My Words...
Chetan garg
Chetan garg

Posted on • Originally published at chetangupta.net

BigBrainKotlin#3 | Spin My Words...

Don't be a Java-ish dev in Kotlin-ish world, improve your knowledge about Koltin Standard Library and write better Kotlin code. ✌🏻 If your Java dev migrating to Kotlin this will help you learn alot!

BBK

The aim of these articles is not hate on Java, but to help people learn various ways in which they can write the same logic better and more Kotlin standard library focused way.

Question:
Write a function that reversed all words in the String whose length is five or more letter words reversed.

spinWords( "Hey fellow warriors" ) => returns "Hey wollef sroirraw" 
spinWords( "This is a test") => returns "This is a test" 
spinWords( "This is another test" )=> returns "This is rehtona test"
Enter fullscreen mode Exit fullscreen mode

Try it out yourself, or submit it in the comments before checking out my solutions.

👉 BigBrainKotlin#3

Hope to see you on the other side...

Until next time. Happy Hacking! 👩‍💻

Stalk Me 👀 :
LinkedIn | Medium | Twitter | StackOverflow | CodeWars |WorkX |Github |Instagram |Youtube

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️