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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:00:40+00:00 2026-06-16T20:00:40+00:00

Give a two-dimensional array T with base type String and some string str (which

  • 0

Give a two-dimensional array T with base type String and some string str (which can be treated like an array of type String) I want to check if T contains certain parts str as its entries. I tried this:

int indeksck = str.indexOf("C");

while(k<T.length){
    if(T[k][2] == str.substring(indeksck+1)){
        if(T[k][1] == str.substring(6, indeksck)){
            int ile_o = Integer.parseInt(T[k][0]);
            T[k][0]= Integer.toString(ile_o+1);
            T[k][3] = T[k][3]+"X"+str.substring(1,6);
            k = T.length+1;
        } else {
            k++;
        }

    } else {
        k++;

        if(k==T.length){
            k = 0;
            while(k<T.length){
                if(T[k][0]==null){
                    T[k][0] = Integer.toString(1);
                    T[k][1] = str.substring(6,indeksck);
                    T[k][2] = str.substring(indeksck+1);
                    T[k][3] = str.substring(1,6);
                    k = T.length+1;
                } else {
                    k++;
                }
            }
        }
    }
}

The problem is that the first part of my code is being ignored (even when condition should be satisfied). I would appreciate and suggestions on solving this problem.

  • 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-16T20:00:42+00:00Added an answer on June 16, 2026 at 8:00 pm

    You cannot use == to do string compare. Try:

    if(T[k][2].equals(str.substring(indeksck+1))) {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem related to storing data dynamically in two Dimensional String Array
I'd like to make a method that will accept any two-dimensional array and a
I have an associative array. Two dimensions which I am iterating through like this
I'm making a two-dimensional array like this: var array = []; array.push([plus, alpha]); array.push([john,
I have declared a two-dimensional array, like so: a = [[]] However, when I
I'm making a site in two language ,I want to give a jquery Modal
I'm using two bindings TCP and HTTP. I want to give mex data on
In Clojure, I want to combine two lists to give a list of pairs,
I just wanna ask what best way to work around a Two-Dimensional Array (2
Below is an example of two dimensional array. int s[5][2] = { {0, 1},

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.