Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1.  
  2. public class SearchForThings {
  3.  
  4.  
  5. /* This is a  method that returns an integer value (the location of the string you're searching for, and takes two string inputs, the first being the string in which you will search, and the second being what you're looking for */
  6.  
  7. public int search(String data, String search) {
  8.  
  9. return data.indexOf(search); // returns 5, the index of the first character in "is"
  10.  
  11. }
  12.  
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement