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

  • SEARCH
  • Home
  • 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 8056557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:44:35+00:00 2026-06-05T08:44:35+00:00

Here is the scenario one input String in = <ENTER>title=Java-Samples<ENTER> + <ENTER>author=Emiley J<ENTER> +

  • 0

Here is the scenario one input

String in = "<ENTER>title=Java-Samples<ENTER>" + 
                        "<ENTER>author=Emiley J<ENTER>" + 
                        "<ENTER>publisher=java-samples.com<ENTER>" + 
                        "<ENTER>copyright=2007<ENTER>" +
                        "<ENTER>cool beans<ENTER>";

processs

    in=in.substring(in.indexOf("<ENTER>")+7,in.lastIndexOf("<ENTER>"));
    String[] mSplitted= in.replaceAll("<ENTER><ENTER>", "<ENTER>").split("<ENTER>");
    String mFinal="";

    for(int i=0;i<mSplitted.length;i++)
    {
       System.out.println("values: "+mSplitted[i]);
       mFinal= mFinal+ mSplitted[i];
    }
    System.out.println(mFinal);

output is

title=Java-Samplesauthor=Emiley Jpublisher=java-samples.comcopyright=2007cool beans

Senario 2

input

        String in = "What is the output of: <ENTER><ENTER>echo 6 % 4;";

processes

    in=in.substring(in.indexOf("<ENTER>")+7,in.lastIndexOf("<ENTER>"));
    String[] mSplitted= in.replaceAll("<ENTER><ENTER>", "<ENTER>").split("<ENTER>");
    String mFinal="";

    for(int i=0;i<mSplitted.length;i++)
    {
      // System.out.println("values: "+mSplitted[i]);
       mFinal= mFinal+ mSplitted[i];
    }
    System.out.println(mFinal);

Output
nothing

I want the output to add a new line when is used

  • 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-05T08:44:36+00:00Added an answer on June 5, 2026 at 8:44 am

    Still not 100% on your question but how about this:

    String mFinal = in.replaceAll("<ENTER><ENTER>", "\n").replaceAll("<ENTER>", "");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the scenario, I have a WCF service call that takes one string
I need to convert my string date to datetime type. Here's one date scenario:
Here's the scenario: Process 1 (P1) - reads in various flat files one consequence
Here's the scenario: I have 2 tables with data, one is the 2009 version
I'm looking for best practices. Here's the scenario: Customers can pay for one or
Here is the scenario: I have 2 buttons, one in a form with the
here's my scenario: I have three projects: two DLLs and one console application, let's
Need an expert opinion here: I am trying to implement a scenario in one
I know how to write tab host,but here the scenario is little bit different
Here's my scenario. As part of my app when someone is sent a message

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.