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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:28:58+00:00 2026-06-13T05:28:58+00:00

In C#: If I want to create a message like this: Hi We have

  • 0

In C#: If I want to create a message like this:
“Hi We have these flights for you: Flight A,B,C,D. Which one do you want”

where just the section in bold is dynamic and I pass its value at run time, but its left and right parts are fixed. I can create something like LeftMessage + those variables + RightMessage to create this.
But I was wondering if there is a way of doing it all at once without the need to create two separate left and right messages?

For translation purposes I am putting those left and right messages inside string resources so now I have two separate string resources. Is there a way to do it all at once?

  • 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-13T05:29:00+00:00Added an answer on June 13, 2026 at 5:29 am

    You can use string.Format:

    string template = "Hi We have these flights for you: {0}. Which one do you want";
    string data = "A, B, C, D";
    string message = string.Format(template, data);
    

    You should load template from your resource file and data is your runtime values.

    Be careful if you’re translating to multiple languages, though: in some cases, you’ll need different tokens (the {0}) in different languages.

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

Sidebar

Related Questions

My sql table is something like (message,created) I want to select those rows which
i want to create a messenger and i have those models: Account Message Message
(Using Oracle) I have a table with key/value pairs like this: create table MESSAGE_INDEX
I would like to have a mapped class named Message. This class should include
I want to create a simple message of Your comment has been posted! using
I want to create a logger which logs all my messages sent to System.out
Hi I have created a zend_form_element_submit. Now i want to display a confirmation message
I want create wordpress website into which I want create user management... That means
I want to achieve something like this in Enterprise Architect's Communication Diagrams: start() ----------------
I would like to create an array (in php) from sql results like this:

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.