Common String Operations and their application in Java

Concatenation

Ex:

Substring

  • public String substring (int startIndex)
  • public String substring (int startIndex, int endIndex)
  • startIndex: inclusive
  • endIndex: exclusive

Ex:

Ascii conversion

Ex:

  • The ASCII value of a is: 97
  • The ASCII value of a is: 97

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store