Lesson 23 of 34

StringBuilder: Strings വേഗത്തിൽ നിർമ്മിക്കൽ

8 min 30 XP

Strings immutable ആയതിനാൽ loop-ലെ += ഓരോ തവണയും പുതിയ String ഉണ്ടാക്കുന്നു, അത് മന്ദഗതിയിലാണ്. StringBuilder mutable-ഉം വേഗമേറിയതുമാണ്. String vs StringBuilder സാധാരണ interview ചോദ്യമാണ്.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

split() ഒരു String-നെ String array ആയി മുറിക്കുന്നു, String.join() കഷണങ്ങൾ വീണ്ടും ചേർക്കുന്നു.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

Challenge

+30 XP

ഒരു വാക്യം വായിച്ച് അതിലെ വാക്കുകൾ വിപരീത ക്രമത്തിൽ print ചെയ്യൂ. Input: I love Java Output: Java love I

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.