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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:09:44+00:00 2026-06-16T09:09:44+00:00

int locctr = 0,toknum = 0; String temp; String d; String [] tok =

  • 0
int locctr = 0,toknum = 0;

    String temp;
    String d;
    String [] tok = new String[500];
    String[] lines = CODE.getText().split("\n");
    try
    {
        for(int i=0;i<lines.length;i++)
        {
            temp = lines[i];
            if(temp != null)
            {
                StringTokenizer st = new StringTokenizer(lines[i],":,\t[]",true); 
                while (st.hasMoreTokens())
        {
                    String ss=st.nextToken();
                    tok[toknum] = ss;  
                    toknum++; //increment
                }
            }
        }
        System.out.print("tok[0] is "+tok[0]);
        boolean r = tok[0].equalsIgnoreCase(".DATA");
        System.out.print("r is : "+r);
        if(r == true)
        {
           System.out.print("\n      INSIDE .DATA"); 
        }
    }
    catch(Exception e)
    {

    }

// input should be accepted for CODE …its been accepted using a .txt file
CODE contains

.DATA
 DATAENDS

this code should be executed on button click……

PROBLEM : even when the value @ tok[0] = .DATA its returning false…..have checked the tok[] array to the data is getting assigned correctly…..
but
condition it still gives false…..

OUTPUT :

     temp is .DATA
         SS IS .DATA
         tok[num] .DATA
         toknum 0
     temp is DATAENDS
         SS IS DATAENDS
         tok[num] DATAENDS
         toknum 1tok[0] is .DATA
    r is : false
  • 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-16T09:09:45+00:00Added an answer on June 16, 2026 at 9:09 am

    When you find equals or equalsIgnoreCase is returning false when it should has return true. use trim to rescue.

    if(tok[0] != null && tok[0].trim().equalsIgnoreCase(".DATA"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

int* p_bob = new int; *p_bob = 78; The above code makes sense to
int[] arr = new int[5]; Console.WriteLine(arr.Count.ToString());//Compiler Error Console.WriteLine(((ICollection)arr).Count.ToString());//works print 5 Console.WriteLine(arr.Length.ToString());//print 5 Do you
int queryVector = 1; double similarity = 0.0; int wordPower; String[][] arrays = new
int main() { int i; FILE *list,*file; char temp[30]; list=fopen(filelist,rb); while(fgets(temp,30,list)!=NULL) { file=fopen(temp,r); {
int lf = ((t.left==null) = (t.right==null)) ? 1:0; it returns 1 if the statement
int n == 0; if (n == null) { Console.WriteLine(......); } Is it true
int n; std::cin >> n; std::string s = ; std::getline(cin, s); I noticed that
int LinkedList::DoStuff() { Node *Current = next_; while ( Current != NULL ) {
int? test; try { test = (int?) Int32.Parse (7); } catch {} if (test
int x; int iHateDataRows = dt.Rows.Count + 2; System.Data.DataRow[] dra = new System.Data.DataRow[1000]; for(x

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.