indexOf method

package app;

public class Main
{
    public static void main(String[] args)
    {
        String text = "123 456 56 78";
        int idx = text.indexOf("56");

        System.out.println(idx); // 5
    }
}

Leave a Comment

Your email address will not be published. Required fields are marked *