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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:49:28+00:00 2026-06-12T05:49:28+00:00

String text = select ename from emp; I want to know the space index

  • 0
 String text = "select ename from emp";

I want to know the space index after the word from. How to do it?

  • 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-12T05:49:30+00:00Added an answer on June 12, 2026 at 5:49 am

    If you’re specifically looking for the index of the first space after the word “from”, you can use:

    text.substring(text.indexOf("from")).indexOf(' ');
    

    If you’re trying to do something more general, than you’ll need to give a bit more information. But the indexOf() method will probably be very useful to you.

    Edit: This should actually be

    text.indexOf(' ', text.indexOf("from"));
    

    The first version returns the index relative to “from”, whereas the second returns the index relative to the original string. (thanks @jpm)

    This loop will find all space characters in the given string:

    int index = text.indexOf(' ');
    while (index >= 0) {
        System.out.println(index);
        index = text.indexOf(' ', index + 1);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this string: Test: String And I want to select the text before
Is is possible to select specific text string on the page directly without a
How do i select the preceding nodes of a text node starting from a
At my form, I have one control ComboBox. I want after databinding add text
My idea: I select a string/text and drop it on my app's icon. My
I have a sql select like below: select * from table1 where text in
The context public class Item { public int Index; public string Text; } ...
In a string I have somthing like this: [select|blog] Some text some text some
String match = hello; String text = 0123456789hello0123456789; int position = getPosition(match, text); //
According to the docs String text = String.format(%5.1e, 3.1415f); Should produce something like 3.1E+00

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.