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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:33:48+00:00 2026-05-23T11:33:48+00:00

How to search for a specific text inside a string-array item element? The following

  • 0

How to search for a specific text inside a string-array item element? The following is an example of the xml file. The string-array name is android. I have some items inside the string-array. Now I want to do a search for the word “software”. Please tell me how to do that?

<?xml version="1.0" encoding="utf-8"?><resources>
<string-array name="android">
    <item>Android is a software stack for mobile devices that includes an operating system, middleware and key applications.</item>
    <item>Google Inc. purchased the initial developer of the software, Android Inc., in 2005..</item>
</string-array>

  • 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-05-23T11:33:48+00:00Added an answer on May 23, 2026 at 11:33 am

    I assume that you want to do this in code. There’s nothing in the api to do text matching on an entire String array; you need to do it one element at a time:

    String[] androidStrings = getResources().getStringArray(R.array.android);
    for (String s : androidStrings) {
        int i = s.indexOf("software");
        if (i >= 0) {
            // found a match to "software" at offset i
        }
    }
    

    Of course, you could use a Matcher and Pattern, or you could iterate through the array with an index if you wanted to know the position in the array of a match. But this is the general approach.

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

Sidebar

Related Questions

I have a list of xml elements that i need to search for specific
I have a multidimensional array. I need to search it for a specific range
I have used file search functionality in eclipse to replace a specific occurrence of
My problem is simple. I search a specific pattern in a file (let's say
For my purposes, I need to search for a specific node in an xml
I'm having trouble selecting the text inside a span element that resides in another
I have a problem that i want to search in the specific locations in
I want to search for a specific text in excel sheet from javascript for
I need to search through an HTML document for two specific strings of text
I need to search a specific column for every occurrence of a string and

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.