0
wap to print first three and last three char of string.
2 Antworten
+ 2
str.at(0)
str.at(1) For the first three
str.at(2)
str.at(str.length() - 1)
str.at(str.length() - 2) For the last three
str.at(str.length() - 3)
0
Take 2 string variables.Say str1 and str2
store the string in str1.Then use the code
str2=str1.substring(starting index value,3rd index value)+str1.substring(3rd last index value,last index value).Then print str2.