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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:12:49+00:00 2026-06-13T02:12:49+00:00

Is it possible to use string formatting string.Format(stuff happened on {0}, date) , but

  • 0

Is it possible to use string formatting string.Format("stuff happened on {0}", date), but also format the date using date formatting?

I could of course use string.Format("stuff {0}", date.ToString("d")); however, that won’t fly when I’m using StringFormat in a XAML binding like this:

<TextBlock Text={Binding SomeDate,StringFormat='{}stuff happened on {0}'} />
  • 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-13T02:12:51+00:00Added an answer on June 13, 2026 at 2:12 am

    This is possible using the lesser-known optional parts of the format item. Those are alignment and formatString in index [,alignment] [:formatString].

    So, I can answer my question using the following:

    <TextBlock Text={Binding SomeDate,StringFormat='{}stuff happened on {0,10:d}'} />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use std::string instead of char* whenever possible, but I worry I
I'd like to use date time format string (possibly UTC) which is understandable and
I was juste wondering if it was possible to use String.Format with the following
Possible Duplicate: std::string formatting like sprintf Can I use the c++ iostream classes with
Possible Duplicate: How can I use a string with the same name of an
Is it possible to use php to search a string for a file path
In eclipse, is it possible to use the matched search string as part of
Possible Duplicate: Enforcing spaces in string resources This is the strings.xml file I use
I use getSelection() (javascript) to get a string onmouseup. Is it possible to get
Using str.format() is the new standard for formatting strings in Python 2.6, and Python

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.