public class Delstreng { boolean result = false; int startIndex, endIndex; public boolean doTestDelstreng(String tekst1, String tekst2) { startIndex = tekst1.indexOf(tekst2); endIndex = startIndex + tekst2.length(); String substring = tekst1.substring(startIndex,endIndex); if (substring != null || !substring.equals("")) { result = true; } else { result = false; } return result; } public int getStartIndex(String tekst1, String tekst2) { startIndex = tekst1.indexOf(tekst2); return startIndex; } }