Click here to Skip to main content
15,887,836 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Java
public static void main(String[] args) {
		// TODO Auto-generated method stub
		String str = "567890432";
		dd d = new dd();
		System.out.println(d.findindexof(str, 2));
// value at index 2 is 6

	}

	public int findindexof(String str, int a) {

		for (int i = 0; i < str.length(); i++) {
                if(){}
			//what would be code over here

		}
		return 0;
	}
}
Posted
Updated 16-Dec-14 3:18am
v2

Why Reinvent The Wheel?
Java - String indexOf() Method[^]
 
Share this answer
 
C#
public static void main(String[] args) {
        // TODO Auto-generated method stub
        String str = "567890432";
        dd d = new dd();
        System.out.println(str.indexOf(6));
// value at index 2 is 6

}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900