How to get first two characters of a string in java

2

We can get first two character of a string in java by using subString() method in java To get first N numbers of a string s.substring(0,n); Lets see an example java program on how to get first two characters or first N characters. Program #1: Java Program

Read this post on instanceofjava.com


saidesh

blogs from hyderabad

Recommended for you