public class Test{
public static void main(String[] args) {
String str1 = "hello";
String str2 = "world";
System.out.println(
combineStrings(str1, str2)
);
}
static String combineStrings(String s1, String s2) {
return
s1.substring(0, s1.length() / 2) +
s2 +
s1.substring(s1.length() / 2);
}
}
Kod ishga tushirilsa natijada nima ko'rinadi ?
public static void main(String[] args) {
String str1 = "hello";
String str2 = "world";
System.out.println(
combineStrings(str1, str2)
);
}
static String combineStrings(String s1, String s2) {
return
s1.substring(0, s1.length() / 2) +
s2 +
s1.substring(s1.length() / 2);
}
}
Kod ishga tushirilsa natijada nima ko'rinadi ?