0
I have a class who catches a String
and look at the first character and if the character is empty (" ") it returns me the first letter.
public String textReturn(String x){
int v1 = 0,v2 = 1;
String a =" ";
while(true){
if( x.substring(v1,v2).equal(" ")){
a = x.substring(v1,v2);
break;
}else{
v1++;
v2++;
}
}
return a;
}
But this text comes from a Edittext and if in it I give an account as if it were a character, I wonder how do I get to skip the line break or if it is also a character like String a.Equal(b/)
Normally Edittext members have a "text" property that already returns the text without special characters. You could use something like: textReturn( editText.text). But your question is not very clear I may not have understood the real problem
– Rodrigo Sidney
this my method takes any text and checks if the first character is empty ('" "), if it is empty it looks at the second otherwise it returns me the character... it works, but if I give an entity it breaks the line and when he looks at the first character will not ta empty because he considers the line break a character... wanted to know what is the symbol of the line break to compare or how to skip the line break and go to the next character.
– Francianderson
How do you pass the text of Edit to him? I don’t understand how "Enter" is going inside the string, not taking the "pure" text of Edit?
– Rodrigo Sidney
i call the textReturn(edittext.gettext) method and then my method checks the characters. but if in Edittext I hit Enter it considers line breaking a character
– Francianderson
type so the method looks at the characters and skips the empty characters and shows me on the screen the first letter, using Toast, .. this work, I can give as much space as I want it to skip the spaces and return me the first letter, but when I press Enter it returns me in empty Toast
– Francianderson