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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:48:27+00:00 2026-05-11T20:48:27+00:00

Is there an inexpensive way to concatenate integers in csharp? Example: 1039 & 7056

  • 0

Is there an inexpensive way to concatenate integers in csharp?

Example: 1039 & 7056 = 10397056

  • 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-11T20:48:27+00:00Added an answer on May 11, 2026 at 8:48 pm

    If you can find a situation where this is expensive enough to cause any concern, I’ll be very impressed:

    int a = 1039;
    int b = 7056;
    
    int newNumber = int.Parse(a.ToString() + b.ToString())
    

    Or, if you want it to be a little more “.NET-ish”:

    int newNumber = Convert.ToInt32(string.Format("{0}{1}", a, b));
    

    int.Parse is not an expensive operation. Spend your time worrying about network I/O and O^N regexes.

    Other notes: the overhead of instantiating StringBuilder means there’s no point if you’re only doing a few concatenations. And very importantly – if you are planning to turn this back into an integer, keep in mind it’s limited to ~2,000,000,000. Concatenating numbers gets very large very quickly, and possibly well beyond the capacity of a 32-bit int. (signed of course).

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

Sidebar

Related Questions

Is there a native or inexpensive way to check for the length of a
I was wondering if there was an inexpensive way to get the width and
Is there a fairly inexpensive source control product on the market that integrates into
There are many conflicting statements around. What is the best way to get the
I'm looking for an inexpensive way of batch converting 1300 PDF documents to XPS
I've been using several VCS systems and wondered: Is there any free or inexpensive
Are there inexpensive or free gateways from .NET to Java? I'm looking at some
There seem to be very different opinions about using transactions for reading from a
There seems to be a similar question to this on here but with the
There are load balanced tomcat web servers. Every request could be served by different

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.