If the string really does include the character SEQUENCE "\n" then
simply searching for the CHARACTER '\n' will not find it but will find
a newline character.  This is because '\n' is simply a convenience for
producing the 0x0A (newline) character value -- it's not conceptually
two separate characters.  Note that you could create the character
SEQUENCE "\n" by assigning the literal "\\n" to a String variable, or
by reading the two sequential characters '\' and 'n' from some
external medium.

You do need to be aware that some interfaces will automatically
convert a "\n" sequence to a newline character, and make sure you
don't inadvertently cause such a conversion -- once "\n" has been
converted to newline then there's no way to tell the difference.

On Feb 21, 1:50 pm, André <[email protected]> wrote:
> I know this is more of a java question than a android question, but I
> know most of you are pro's here an both so I'll ask it here!
> Is it possible to search a string that I have taken from an edittext
> for when ever the value for new line comes?
> But this string might include \n so I want it to ignore that a go for
> the value 10 instead. (which is the value for new line if I remember
> correctly)
> Is this possible or should I use something else of string when I look
> for a new line?
>
> Appreciate any answers!
> //André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to