Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7913763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:55:09+00:00 2026-06-03T13:55:09+00:00

How do i remove that last | from my even/odd condition? Example: import java.io.*;

  • 0

How do i remove that last | from my even/odd condition?

Example:

import java.io.*;
import java.net.Socket;

public class Test {

  public static String _noManualTraceIt = "0008e07cd8ec6cfdb900283508004500004a7d8d400080060000c0a80087c0a800c6c6931388956304704eebd50c5018ffff82da0000674500000504000000000000030000000000000000000000060000000000ff210000";
  public static void main(String[] args) throws IOException {
    System.out.println( wireShirk(_noManualTraceIt) );
  }

  public static byte[] wireShirk(String bytes) throws IOException {
    String temp = "";
    String replaceIfOnLastFound = "||&|\r\n|\n\r|etc|etc";

    int _i = 0;
    do {
      temp += bytes.charAt(_i);     
      if(_i%2 ==0) {
      } else {
        temp += "|";
      }
      System.out.println(bytes.length() + " " + _i + " " + two.charAt(_i) + " " + temp);
      _i++;
    } while(_i<bytes.length());

    bytes = temp; // << replaceIfOnLastFound any of those characters 
                  // | or & or \r\n or etc etc from that variable


    String byteArrayStr[] = bytes.split("\\|");
    byte bytesArray[] = new byte[byteArrayStr.length];
    for (int i = 0; i < byteArrayStr.length; ++i) {
      bytesArray[i] = (byte) (Integer.parseInt(byteArrayStr[i], 16));
    }
    return bytesArray;
  }  

}

Output:

176 175 0 00|08|e0|7c|d8|ec|6c|fd|b9|00|28|35|08|00|45|00|00|4a|7d|8d|40|00|80|06|00|00|c0|a8|00|87|c0|a8|00|c6|c6|93|13|88|95|63|04|70|4e|eb|d5|0c|50|18|ff|ff|82|da|00|00|67|45|00|00|05|04|00|00|00|00|00|00|03|00|00|00|00|00|00|00|00|00|00|00|06|00|00|00|00|00|ff|21|00|00|
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T13:55:10+00:00Added an answer on June 3, 2026 at 1:55 pm

    add if statement inside loop ..

    } else {
       if(i < bytes.length - 1){
        temp += "|";
       }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to remove a class that has been appended to a div id? Earlier
I have an event handler that will remove an element from a list of
I'm trying to make a trigger that will remove rows from one table based
I'm writing a unit test for a Text Scrubber utility that will remove any
I simply want a class that does this: class cleanup : boost::noncopyable { public:
How can we remove last comma from a comma seperated list in SQL query?
RemoveDirectory() removes only empty directories. How do I remove directories that have files inside?
How can I filter a string in c? I want to remove anything that
Has anyone written a macro that will remove and sort your usings in an
How do I remove the label that comes attached to the TextArea I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.