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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:01:21+00:00 2026-05-24T21:01:21+00:00

How can I convert array of string to string? Or any idea else? I

  • 0

How can I convert array of string to string? Or any idea else?

I am doing it like this:

var
    s:string;
    i:integer;
begin
    for i:=1 to 10000 do
    begin
        if (i mod 2)=0 then
            s:='a'+s
        else
            s:='b'+s;

    end;
end;

And as you see i is going to large number 1000 or 10000 or 10000 so it means 10000 times I have to do this, how can I do this very short time..Using array? Please an example code..

  • 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-24T21:01:22+00:00Added an answer on May 24, 2026 at 9:01 pm
    SetLength(s, n);
    for i := 1 to n do
      s[i] := ...
    

    Is the idiom you need.

    Your code is slow because it performs memory allocation and copying on every iteration. This approach of pre-allocating the buffer avoids that.

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

Sidebar

Related Questions

How can you convert a byte array to a hexadecimal string and vice versa?
Can we convert a hex string to a byte array using a built-in function
Seeing as you can convert any document to a byte array and save it
how can i convert this into an array? if someone searches for lo he
How can I convert a Class to byte array in C#. This is a
I would like to convert a raw string to an array of big-endian words.
Possible Duplicate: convert string to 2D array using php I have the string like
I wanted to convert string into array of bytes . How can i do
I have an array of Strings like this: private String time[] = {8:00:00 AM,
I have a string value like: 1,2,3;4,5,6;7,8,9;a,b,c;d,e,f;g,h,i I need to convert it into array

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.