Lets say hello.txt contains the string "Hello John". I have a string variable str="dear". I need to insert it directly into the file after Hello i.e. after 5th position. After executing the function file must contain "Hello dear John".
Is there a function for this in Java?