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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:08:16+00:00 2026-06-12T14:08:16+00:00

I have a search strings and I need to replace search string character to

  • 0

I have a search strings and I need to replace search string character to different textview string with bold style .
below may code:

![First screen to load array][1]
![search string in array][2]
![replace all string textview by search string][3]

I do not want replace all string of textview because i want bold only specific character from position of different textview string.

![enter image description here][4]

I want this format replace style bold.

String strlottery=”17659″;

TextView txtS = (TextView) findViewById(R.id.textView5);
TextView txtT = (TextView)findViewById(R.id.textView6);
 TextView txt1 = (TextView) findViewById(R.id.textView9);
TextView txt2 = (TextView) findViewById(R.id.textView13);
TextView txt3 = (TextView) findViewById(R.id.textView17);

String str=strlottery.replaceAll("1", "<font size=\"16\" color=\"red\"><b>"+"1"+"</b><</font>");                       
Log.v("Search", str);
Spanned text = Html.fromHtml(str);
txtf.setText(text);
txtS.setText(text);
txtT.setText(text);
txt1.setText(text);
txt2.setText(text);
txt3.setText(text);

This is my search string and i want to search this string in to the arraylist then i want to bold those character when getting on the arraylist.
ArrayList string is 18758,13660,52798,16514,70679.

But this is replace all Textview String by the 17659 string with match charater bold style. 1879 search string this is replace old string but i donot want this type replace .i want only specific position character change in bold style

  • 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-12T14:08:17+00:00Added an answer on June 12, 2026 at 2:08 pm

    Following is the way to do this..define start and end of text and perform actions on part of text…..cheers!!!!!!!!

    TextView myText = (TextView) findViewById(R.id.scoreboardtitle);
        SpannableString text = new SpannableString("Top Scores");  
        // make "Lorem" (characters 0 to 5) red  
        text.setSpan(new ForegroundColorSpan(Color.RED), 0, 4, 0);
        text.setSpan(new ForegroundColorSpan(Color.rgb(0, 255, 0)), 4, text.length(), 0);
        text.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    
        myText.setText(text, BufferType.SPANNABLE);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a NSMutableArray that I need to search for a string and return
I need all records which have year entered from search criteria. for ex: String
I need three fast-on-large-strings functions: fast search, fast search and replace, and fast count
I have a string, say: www.google.com/tomato.mdm I need to replace tomato with tomaton (add
I only have access to 'C' and need to replace characters within a character
I have a string with certain pattern. I need to search for the pattern
I have two characters that I need to do a search and replace on
I have a string in a django/python app and need to search it for
I have a search replace script which works to replace strings. It already has
I have search strings, similar to the one bellow: energy food olympics 2010 Terrorism

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.