A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

Write a Java program to insert a word in the middle of the another string
Q:

Write a Java program to insert a word in the middle of the another string

0

Write a Java program to insert a word in the middle of the another string
Insert "Tutorial" in the middle of "Python 3.0", so result will be Python Tutorial 3.0


Sample Output:

Python Tutorial 3.0

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import java.lang.*;
 public class Exercise67 {
 public static void main(String[] args)
 {
   String main_string = "Python 3.0";
   String word = "Tutorial";
   System.out.println(main_string.substring(0, 7) + word + main_string.substring(6));
	}
}

Sample Output:

Python Tutorial 3.0

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now