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 8982999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:43:23+00:00 2026-06-15T20:43:23+00:00

I have gone over and over this code and can’t see where this is

  • 0

I have gone over and over this code and can’t see where this is happening it doesn’t happen every time it only happens if I run through post twice but I have tried getting rid of each of these in turn by commenting them out and that still gives the error but if I get rid of both my code works fine but they are necessary and they did work before. Any help is appreciated.

if(lines[i].length() > 10)
{
    if(lines[i].charAt(4) == '-' && lines[i+1].charAt(4) == '-')
    {
        lines[i] = "\nComment";
    }
}
if(lines[i].length() > 10)
{
    if(lines[i].charAt(4) == '-' && lines[i+1].charAt(4) != '-' && !lines[i-1].equals("\nComment"))
    {
        lines[i] = "\nPost";
    }
}
  • 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-15T20:43:25+00:00Added an answer on June 15, 2026 at 8:43 pm

    Your code does not check

    • that lines[i+1] exists,
    • that lines[i-1] exists, and
    • that the length of lines[i+1] is at least five.

    This would break when i is zero or lines.length-1, or when one of the prior/next lines has less than five characters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok I am getting this FC error. I have gone over the code three
I have some code that I have gone over at least 30 times by
I am sure someone has gone over this but I have had no luck
Okay I have tried this from every angle I can think of and I
I have gone through this to change the color of my title bar. I'm
I have gone through this page... http://www.php.net/manual/en/function.hash.php MD5 is 32 characters long while sha1
I have gone through the fadein/fadeout tutorial that is on this page: For the
I have gone through many posts on SO regarding this issue: Tried everything in
I have gone through this and this , but the question I am asking
I have a solution with over 100 projects. It takes a long time to

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.