+ 2
How i search a random string in file in java??
String s1 = new String(); s1 = "Nakul" then how i search for string s1 in any file.
1 Answer
+ 2
Hello Nakul Singh
At first:
Either s1 = new String("Nakul");
or s1 = "Nakul";
You need to read a file.
Here is a good tutorial how to work with files: https://stackabuse.com/reading-and-writing-files-in-java/