Strings In Java

Strings are defined as an array of characters. The difference between a character array and a string is the string is terminated with a special character ‘\0’.
Below is the basic syntax for declaring a string in Java programming language.
Syntax:
<String_Type> <string_variable> = “<sequence_of_string>”;
Example:
String str = "Bikramjot";
Java String Methods
  • String charAt() 
  • StringcompareTo()
  • String concat()
  • String contains()
  • String endsWith()
  • String equals()
  • equalsIgnoreCase()
  • String format()
  • String getBytes()
  • String getChars()
  • String indexOf()
  • String intern()
  • String isEmpty()
  • String join()
  • String lastIndexOf()
  • String length()
  • String replace()
  • String replaceAll()
  • String split()
  • String startsWith()
  • String substring()
  • String toCharArray()
  • String toLowerCase()
  • String toUpperCase()
  • String trim()
  • String valueOf()

Comments

Popular posts from this blog

Flutter : Introduction

Dart: Functions

Firebase Cloud Messaging