Understanding StringBuilder Class Methods [append(), capacity(), charAt(), delete(), deleteCharAt()] in Java using Eclipse IDE

in #utopian-io7 years ago (edited)

In this tutorial, you will learn the following:

  • StringBuilder Methods:
    • append()
    • capacity()
    • chartAt()
    • delete()
    • deleteCharAt()

You would need the following inorder to following this tutorial:

  • An Integrated Development Environment(IDE) installed that can run Java (e.g Eclipse, IntelliJ,Netbeans)
  • JDK 1.X installed on your Pc
  • Of course willingness to learn

Difficulty

  • Intermediate

Description

In this tutorial, we take a look at the StringBuilder class.
Strings are immutable meaning they cant e destroyed once created, but a StringBuilder is mutably making it the best option for string manipulation.
The following are a few methods amongst many:

append(): This method appends a string to the created/ declared StringBuilder object.

capacity(): This method gets the capacity of the StringBuilder which is gotten by the formula 16 + number of characters including white spaces.
charAt(index): This method returns the character at the specified index in the StringBuilder object.

Video Tutorial Link:

NB: This video has only being shared on my Youtube Channel

Tutorial codes can be gotten from this github repository: https://github.com/generalkolo/Javacodes



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

@edetebenezer, Contribution to open source project, I like you and upvote.

Your contribution cannot be approved because it does not follow the Utopian Rules.

  • This is very simple. You need to refer to the new rules that took effect from 2nd feb.
    You can contact us on Discord.
    [utopian-moderator]

Coin Marketplace

STEEM 0.16
TRX 0.13
JST 0.027
BTC 60589.35
ETH 2628.62
USDT 1.00
SBD 2.53