java using .indexof to fin a space
class Sample{
public static void main(String[] args) {
String s = "1110 001";
int index = -1;
for(int i = 0; i < s.length(); i++ ){
if(Character.isWhitespace(s.charAt(i))){
index = i;
break;
}
}
System.out.println("Required Index : " + index);
}
}
Also in Java:
- java recursion
- binary number input in int java
- how to add element to arraylist
- thymeleaf Expression Object dialects
- declareing a variable in java
- java get last char of string
- biginteger in java
- getindexrequest elasticsearch
- goodbye java
- java windowbuilder full screen
- basic java coding
- treeset java descending order using comparator
- java array declaration
- java create inputstream from string
- android image view showing rotate image
- how to count the number of occurrences of an element in a arraylist in java
- java put a char array into a string
- find the day of the week Calendar class in java
- java bigdecimal compareto
- java valeur absolue
- primitive data types in java
- get tfidf score for a sentence
- java string contains at beginning
- java clear bufffer to take next string inpuit