Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
Ron McLeod
Junilu Lacar
Liutauras Vilda
Sheriffs:
Paul Clapham
Jeanne Boyarsky
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Piet Souris
Carey Brown
Bartenders:
Jesse Duncan
Frits Walraven
Mikalai Zaikin
Forum:
Beginning Java
How to take out value from StringBuilder
Sharon Wong
Ranch Hand
Posts: 39
I like...
posted 5 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
final List<Token> msgTokens = ir.getMessage(templateId); int blockLength = messageHeader.blockLength(); String sDelimiter = String.valueOf((char) 1); StringBuilder sbFIX = new StringBuilder(); sbFIX.append("8=").append(ir.semanticVersion()).append(sDelimiter); sbFIX.append("35=").append(msgTokens.get(0).encoding().semanticType()).append(sDelimiter); sbFIX.append("34=").append(packetHeader.MsgSeqNum()).append(sDelimiter); sbFIX.append("52=").append(convertUTCTimeStamp(packetHeader.sendingTime())).append(sDelimiter); sbFIX.append("001=").append(sdf.format(new Date())).append(sDelimiter); OTFMsgDecoder otfMsgDecoder = new OTFMsgDecoder(); bufferOffset += messageHeader.size(); String sFIX = otfMsgDecoder.decodeToString(packetDirectBuffer, bufferOffset, messageHeader.version(), blockLength, msgTokens, new SBEDecoder()); otfMsgDecoder.getBufferIndex(); bufferOffset += iMsgSize; bufferOffset -= messageHeader.size(); String str = new StringBuffer().append(sbFIX).append(sFIX).toString();; ArrayList<String> list = new ArrayList<>(); if(!str.equals("35=A") || !str.equals("35=2") ){ list.add(str); out.println("str :" + str); }
the output str will be as image i attached.
for if statements, if the STR for 35= not equals A or 2, array list for list will be add.
please kindly advice how to do it? because when running, all the contents 35=A or 35= 2 also include.
Thanks
Sharon Wong
Ranch Hand
Posts: 39
I like...
posted 5 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Add image
webpage
I think image for first post cant view.
Jesper de Jong
Java Cowboy
Posts: 16084
88
I like...
posted 5 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Welcome to the Ranch.
Please don't post the same post twice; continue in
the other copy
.
Jesper's Blog
-
Pluralsight Author Page
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Doubt.......null?
String question
display number xxx as "x x x " method
Why 'equals' methods were not overridden in StringBuffer and StringBuilder?
Setting TextField value
More...