Java tutorial
//package com.java2s; public class Main { public static int getFirstLowOperatorIndex(String text) { int add_index = text.toString().indexOf('+'); int sub_index = text.toString().indexOf('-'); return (add_index <= sub_index) ? add_index : sub_index; } }