Android String Search safeIndexOf(String s, String search)

Here you can find the source of safeIndexOf(String s, String search)

Description

safe Index Of

License

Open Source License

Declaration

public static int safeIndexOf(String s, String search) 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

public class Main {
    public static int safeIndexOf(String s, String search) {
        final int i = s.indexOf(search);
        if (i == -1) {
            return s.length();
        }/*ww  w.j  a  va 2 s . c  o m*/
        return i;
    }
}

Related

  1. indexOf(String str, String searchStr)
  2. skipSpaces(String s, int start)
  3. nestedIndexOf(final String s, final int startPos, final String open, final String close)
  4. findFirstNotOf(String str, String chars)