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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:37:55+00:00 2026-06-10T01:37:55+00:00

For my app I have created a QR Code, then took that bitmap and

  • 0

For my app I have created a QR Code, then took that bitmap and added text to the bitmap, however I need the text not to extend longer then the bitmap is. So what I want to do is create an Array of the text by taking 25 characters then find the last index of (” “) in that 25 character section. at that space I want to be able to replace that space that was located with \n to start a new line.

So the plan is if I have a String that looks like “Hello this is my name and I am longer than 25 charters and I have lots of spaces so that this example will work well.“

I want it to out up this

Hello this is my name and
I am longer than 25 
charters and I have lots 
of spaces so that this 
example will work well.

To make this I counted 25 characters then went back to the most resent space, at that point I hit enter, I want my app to do this for me.

I am not very good at English so if something doesn’t make sense tell me and I will try to explain it. Thanks

  • 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-10T01:37:57+00:00Added an answer on June 10, 2026 at 1:37 am

    I haven’t tested this but you can try it and tweak as necessary

    String fullText = "your text here";
    String withBreaks = "";
    while( fullText.length() > 25 ){
        String line  = fullText.substring(0,24);
        int breakPoint = line.lastIndexOf( " ");
        withBreaks += fullText.substring(0,breakPoint ) + "\n";
        fullText = fullText.substring( breakPoint );
    withBreaks += fullText;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my ipad code created programmatically not using nib.I converted my ipad app
I have created a Server app that receives sound from client, i then broadcast
I have created the app with forge, and have added in the chrome extension,
I have created an app in C# .Net 2.0 that uses the AxShockwaveFlash object
I have an app that connects to a remote chat server and then the
Beginner programmer here....hope it makes sense :) I have created a console app that
I have a simple code that looks up a text file, reads the line
Have created an app-id as normal. Then created an app-store distribution profile...as normal. Set
i have created two buttons and a textbox. the textbox shows the text that
I have created an app, that fetchs data from mysql using php. But when

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.