Obtain person full name with String.Format
, while storing the format string in the Resources
. Resources are culture-specific, and you'll be able to define a different format string per each culture you support.
So if you create a string resource named for example PersonFullNameFormat
, you can define it as "{0} {1}"
for en-US and "{1} {0}"
for ru-RU. Then you can obtain person full name as follows:
var fullName = string.Format(Resources.PersonFullNameFormat, firstName, lastName);
By default, Resources
will return values based on Thread.CurrentThread.CurrentUICulture
. Initially, it matches selected culture in the OS, but you can override it by setting Thread.CurrentThread.CurrentUICulture
to the culture you want:
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-GB");
For more info, see: