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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:59:12+00:00 2026-06-15T22:59:12+00:00

How can I join two strings (both are numbers) together without having them added

  • 0

How can I join two strings (both are numbers) together without having them added together? For example:

@output = 2567 + 18

What I Don’t Want:

The result returns "2585" (it has added the two numbers together mathematically).

What I Do Want:

The result returns "256718". As you can see, this time the two numbers have been joined together, not added.

A Real Example:

Profile.create(:permalink => 2585 && User.last.id)

When I run that line from my model – the row titled "permalink" simply gets the last created user ID, and "2585" isn’t joined in front of it. Also, if I used the "+" method instead of "&&" like in the first example, the two numbers are added together mathematically.

Any ideas?

  • 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-15T22:59:13+00:00Added an answer on June 15, 2026 at 10:59 pm

    Convert both values to strings. The first with a string literal and the second with an explicit conversion using the to_s method.

    Profile.create(:permalink => "2585" + User.last.id.to_s)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables, Foo and Bar, I'd like to join them together so
I have two tables, for Users and Songs. I need to JOIN them both
in F#, array.append can join two arrays; is there a way to append 2
In Vim, one can join two lines by typing capital J. However, these are
Can i join two tables using LINQ for NHibernate like I can do in
How I can join this queries to single select (without temp table)? SELECT t2.value,
How can I join 2 Point3f arrays together? I have tried this but it
According to the release notes of Eclipse 3.3 you can now join lines together
So I have two tables in this simplified example: People and Houses. People can
I have two strings: var str1 = '8***8***'; var str2 = '898-8293'; How can

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.