String s="www.javapro.ir"; |
package java like ; public class CharAtExample { public static void main(String args[]) { String str = "Welcome to string handling tutorial"; char ch1 = str.charAt(0); char ch2 = str.charAt(5); char ch3 = str.charAt(11); char ch4 = str.charAt(20); System.out. print ln("Character at 0 index is: " + ch1); System.out. print ln("Character at 5th index is: " + ch2); System.out. print ln("Character at 11th index is: " + ch3); System.out. print ln("Character at 20th index is: " + ch4); } } |
Character at 0 index is: W Character at 5th index is: m Character at 11th index is: s Character at 20th index is: n |
سایت جاواپرو با هدف تولید محتوای آموزشی با کیفیت رایگان در زمینه برنامه نویسی جاوا و اندروید فعالیت خود را در سال 1395 شروع کرد.امیدواریم بتوانیم دامنه گسترده تری از موضوعات پر نیاز در زمینه برنامه نویسی جاوا و اندروید را البته با حمایت شما پوشش دهیم.
تلفن: 09301904690