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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:38:16+00:00 2026-06-02T06:38:16+00:00

Disclaimer: I KNOW that in 99% of cases you shouldn’t serialize data in a

  • 0

Disclaimer: I KNOW that in 99% of cases you shouldn’t “serialize” data in a concatenated string.

What char you guys use in well-known situation:

string str = userId +"-"+ userName;

In majority of cases I have fallen back to | (pipe) but, in some cases users type even that. What about “non-typable” characters like ☼ (ALT+9999)?

  • 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-02T06:38:20+00:00Added an answer on June 2, 2026 at 6:38 am

    That depends on too many factors to give a concrete answer.

    Firstly, why are you doing this? If you feel the need to store the userId and userName by combining them in this fashion, consider alternative approaches, e.g. CSV-style quoting or similar.

    Secondly, under normal circumstances only delimiters that aren’t part of the strings should be used. If userId is just a number then “-” is fine… but what if the number could be negative?

    Third, it depends on what you plan to do with the string. If it is simply for logging or debugger or some other form of human consumption then you can relax a bit about it, and just choose a delimiter that looks appropriate. If you plan to store data like this, use a delimiter than ensures you can extract the data properly later on, regardless of the values of userId or userName. If you can get away with it, use \0 for example. If either value comes from an untrusted source (i.e. the Internet), then make sure the delimiter can’t be used as a character in either string. Generally you would limit the characters that each contains – say, digits for userId and letters, digits and SOME punctuation characters for userName.

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

Sidebar

Related Questions

Disclaimer: I know that implicit conversion to string should be avoided, and that the
I will preface this question with the disclaimer that I know there are many
Disclaimer : I know that Thread.Abort is evil. I'm using it as a last
!Disclaimer! : Please note that I am talking about untagged declarations. I know it's
Disclaimer: Ok I know that this is being discussed in the thread linked below,
Disclaimer: I know there are better ways to track email open rates, which are
DISCLAIMER: I know there is debate between DI and service locator patterns. I have
Question: How can I document Ruby code using Doxygen? Disclaimer: I know ruby already
Disclaimer: I'm a rails n00b. I'm playing around with a simple helper function that
Disclaimer : I'm quite a novice to RoR, but not with Ruby (if that

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.