Thanks DanH, using '\n' instead of "\n" worked fine!
Sorry Kostya, I wasn't clear enough. I meant, if I have a text in a textview that includes \n as a part of the visual text that the user can see and not as a newline marker. Then how do I look for the actual new line marker and not the \n that is a part of the text. Searching for char '\n' worked very well for that. Thanks both! On Feb 21, 10:18 pm, Kostya Vasilyev <kmans...@gmail.com> wrote: > 21.02.2011 22:50, André пишет: > > > 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) > > The \n *is* the newline marker. So is \12, \x0A, and "char ch = (char) > 10". By the time you get to string.indexOf, it's all the same. > > TextView uses the newline character to represent multiple lines of text > within a single String (or more precisely, a CharSequence). There isn't > anything else there between the lines, but the newline character. > > So your question really sounds to me like "how do I search for the > newline markers, in such a way that I don't find any when they're there" > - which makes no sense to me. > > -- > Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en