Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 773 Bytes

Java.md

File metadata and controls

18 lines (13 loc) · 773 Bytes
  • String index access using text.charAt(index) // text[index] will not work

  • String Compare t1.compareTo(t2) return +v, 0, -v // compare string value with position such as a < b, d > c \n

  • t1 == t2 will not give correct comparism. String t="jahid"; String s=new String("jahid") will compare wrongly \n *text.subString(index_begin, index_end); text(5,8) will return (index 5 to 8-1) if index_end not provided, it will take from the last string *Strings are Immutable //can't modify in Java

  • StringBuilder sb = new StringBuilder("Jahid"); // It is mutable

  • support all the String methods,

  • support more function like

  • sb.setCharAt(index, 'R');

  • sb.insert(index, 'S');

  • sb.delete(index_begin, number_char);

  • sb.append("hello"); // add string at last