Methods are built on actions, Perkins with individual strings.
They help us do things such a:
searching within a string
replacing part of a string
changing the casing of a string
Can also be combined, the syntax is thing.method[].
Trim is used to trim off any space at the start or ending of a string.
Can also chain on two strings for example :
greeting
“hello again ”
greeting.trim().uppercase ()
“Hello Again”
Lots of info to take in but overall a good lesson.
Comentarios