Google-sovellukset
Päävalikko

Post a Comment On: mo.notono.us

"C#: String.Inject() - Format strings by key tokens"

10 Comments -

1 – 10 of 10
Anonymous Anonymous said...

That's really nice work... I grumble about that kind of thing all the time.

Thursday, August 07, 2008 6:04:00 PM

Blogger Oskar Austegard said...

JDP, thanks. I anticipate using it, or an extension of the extension for some upcoming SharePoint work.

I believe the regular expression could be made more readable, and perhaps xslt would be a better parsing mechanism for large strings, but all in all I am happy with this.

Friday, August 08, 2008 8:11:00 AM

Blogger Oskar Austegard said...

This post has now been haacked. I'll have to make some changes and repost at a later date...

Monday, January 05, 2009 10:29:00 AM

Anonymous Anonymous said...

I like this, though ideally I would suggest doing this slightly differently by extending the string class to get string.Inject(object, string) and open up for intellisense since the context would be already set with the first object parameter.

Tuesday, January 06, 2009 5:13:00 AM

Blogger Oskar Austegard said...

@danijels, this IS a string extension. Not sure if you're misunderstanding me, or I'm misunderstanding you...

Tuesday, January 06, 2009 9:06:00 AM

Blogger Oskar Austegard said...

haacked again... Also see Peli's Farm: Named Formats Pex Testimonium

Tuesday, February 03, 2009 5:09:00 PM

Anonymous rahul said...

First of all. Thanks very much for your useful post.

I just came across your blog and wanted to drop you a note telling you how impressed I was with the

information you have posted here.

Please let me introduce you some info related to this post and I hope that it is useful for community.

There is a good C# resource site, Have alook

http://CSharpTalk.com

Thanks again
Rahul

Wednesday, December 23, 2009 8:31:00 AM

Blogger Georges POLITIS said...

Great solution, thank you. can you please clarify why the hosting assembly must be CLSCompliant? I get quite a few warnings with this enabled.

Tuesday, August 17, 2010 4:46:00 AM

Blogger Oskar Austegard said...

@Georges POLITIS:

Hmm - I don't remember, but I suspect it had something to do with either an FXCop or Stylecop demand. I honestly don't know why it would be required.

Tuesday, August 17, 2010 8:35:00 AM

Blogger D. Patrick Caldwell said...

Oskar,

I know this is an old post and you probably don't think about this much anymore, but I recently posted something similar on my blog (.Net Object Formatter).

I posted a similar comment on Phil Haack's blog post.

I put the ObjectFormatter on github and was hoping you'd be interested in contributing.

I know it's a common problem and would love to see something robust come of a collaborative effort.

Thanks,
Patrick Caldwell

Tuesday, August 23, 2011 11:42:00 AM

You can use some HTML tags, such as <b>, <i>, <a>

Comments on this blog are restricted to team members.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot