Parse and find charater in a stream containing \x ...

U

uap12

I have a textfiles that i read from, one trigger is for a dataline
that lookas like this
dmc \x45\x23\x45\x23\x45\x23\x45\x23\x45\x23\x45\x23\x45\x23\x45\x23

i try to trigger this by
if(sDMC.startsWith("DMC \\x")) {
bDMC = true;
}

But i don't get a hit, i know there is som fuzzy about the line
\x45\x23 ... but i can't do any thing about this, any way to do this ?

best regards
Anders
 
A

Andreas Leitgeb

uap12 said:
I have a textfiles that i read from, one trigger is for a dataline
that lookas like this
dmc \x45\x23\x45\x23\x45\x23\x45\x23\x45\x23\x45\x23\x45\x23\x45\x23
i try to trigger this by
if(sDMC.startsWith("DMC \\x")) {
bDMC = true;
}
But i don't get a hit,

Perhaps it's just the case-mismatch dmc vs DMC?
 
R

Roedy Green

i try to trigger this by
if(sDMC.startsWith("DMC \\x")) {
bDMC = true;
}

But i don't get a hit, i know there is som fuzzy about the line
\x45\x23 ... but i can't do any thing about this, any way to do this ?


You can simplify that to:
boolean bDMC = sDMC.startsWith ("DMC \\x");

Dump out sDMC surrounded in [ ] to make lead blanks more obvious.

do you want the letters DMC on the front? If not take them off.
--
Roedy Green Canadian Mind Products
http://mindprod.com

Responsible Development is the style of development I aspire to now. It can be summarized by answering the question, “How would I develop if it were my money?” I’m amazed how many theoretical arguments evaporate when faced with this question.
~ Kent Beck (born: 1961 age: 49) , evangelist for extreme programming.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,689
Members
48,796
Latest member
Greg L.

Latest Threads

Top