Click here to Skip to main content
15,921,716 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Bug of the Day Pin
PIEBALDconsult3-Feb-17 12:04
mvePIEBALDconsult3-Feb-17 12:04 
GeneralRe: Bug of the Day Pin
Chris Maunder3-Feb-17 13:29
cofounderChris Maunder3-Feb-17 13:29 
GeneralRe: Bug of the Day Pin
PIEBALDconsult3-Feb-17 17:16
mvePIEBALDconsult3-Feb-17 17:16 
GeneralRe: Bug of the Day Pin
Vikram A Punathambekar3-Feb-17 20:55
Vikram A Punathambekar3-Feb-17 20:55 
GeneralRe: Bug of the Day Pin
Brady Kelly3-Feb-17 22:48
Brady Kelly3-Feb-17 22:48 
GeneralRe: Bug of the Day Pin
Bryian Tan3-Feb-17 18:29
professionalBryian Tan3-Feb-17 18:29 
GeneralRe: Bug of the Day Pin
Chris Maunder4-Feb-17 7:51
cofounderChris Maunder4-Feb-17 7:51 
GeneralRe: Bug of the Day Pin
Mario Z4-Feb-17 3:16
professionalMario Z4-Feb-17 3:16 
Brady Kelly wrote:
Subtle indeed. I never use char literals unless absolutely necessary. A one char string is a tad expensive in some cases, but surely not in this one.
I agree with that.

Also to me it seems that PartDivider is meant for only formatting purposes (judging from the name itself, aka it's meant for interpolation or concatenation purposes) so it seems kind-of intuitive to specify it as string.

Nevertheless in this kind of cases I always prefer using interpolated (if you can use a higher C# version) or formattable strings, for example:

C#
private const string ObjectRefGuidFormat = "{0}{1:_0}{2:_0}";

// ...

// E.g. "1_2" or "1_2_3".
string objectRefGuid = string.Format(ObjectRefGuidFormat,
    objectRef.ObjectTypeId,
    objectRef.ObjectId,
    objectRef.VersionNumber > 0 ? objectRef.VersionNumber.ToString() : null);

GeneralThought of the day Pin
OriginalGriff3-Feb-17 5:02
mveOriginalGriff3-Feb-17 5:02 
GeneralRe: Thought of the day Pin
User 84203-Feb-17 5:13
User 84203-Feb-17 5:13 
GeneralRe: Thought of the day Pin
Foothill3-Feb-17 6:20
professionalFoothill3-Feb-17 6:20 
GeneralRe: Thought of the day Pin
Bootking3-Feb-17 5:15
Bootking3-Feb-17 5:15 
GeneralRe: Thought of the day Pin
Richard Deeming3-Feb-17 5:19
mveRichard Deeming3-Feb-17 5:19 
GeneralRe: Thought of the day Pin
lopatir3-Feb-17 5:23
lopatir3-Feb-17 5:23 
GeneralRe: Thought of the day (NSFK) Pin
lopatir3-Feb-17 5:50
lopatir3-Feb-17 5:50 
GeneralRe: Thought of the day Pin
Stephen Gonzalez3-Feb-17 5:31
Stephen Gonzalez3-Feb-17 5:31 
GeneralRe: Thought of the day Pin
Sander Rossel3-Feb-17 5:52
professionalSander Rossel3-Feb-17 5:52 
GeneralRe: Thought of the day Pin
jeron13-Feb-17 6:23
jeron13-Feb-17 6:23 
GeneralRe: Thought of the day Pin
W Balboos, GHB3-Feb-17 6:35
W Balboos, GHB3-Feb-17 6:35 
GeneralRe: Thought of the day Pin
Bryian Tan3-Feb-17 7:40
professionalBryian Tan3-Feb-17 7:40 
GeneralDonkey.BAS Pin
Chris Maunder3-Feb-17 4:31
cofounderChris Maunder3-Feb-17 4:31 
JokeRe: Donkey.BAS Pin
ZurdoDev3-Feb-17 4:38
professionalZurdoDev3-Feb-17 4:38 
GeneralRe: Donkey.BAS Pin
Duncan Edwards Jones3-Feb-17 4:47
professionalDuncan Edwards Jones3-Feb-17 4:47 
GeneralRe: Donkey.BAS Pin
den2k883-Feb-17 4:50
professionalden2k883-Feb-17 4:50 
GeneralRe: Donkey.BAS Pin
Bootking3-Feb-17 5:17
Bootking3-Feb-17 5:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.