Monday, March 06, 2017

Quickly add some text for testing

Sometimes I need a lot of text in a control to test something. For something very short I'll just mash the keyboard a few times but when I need something longer a bit more effort is required.
I thought there needs to be something that can generate some text (say, some Lorem Ipsum) when it's needed.
My initial reaction was 'how hard can it be to make such a thing'? But then I caught myself and realized someone must have done this already.
It turns out there are a few.

I chose to use NLipsum.

It's really easy to get it to return some text. Just the following is enough.

NLipsum.Core.LipsumGenerator.Generate(2)


In case it wasn't obvious, this was a quick post to remind me about this and I thought it was cool and useful enough to tell others about.

0 comments:

Post a Comment

I get a lot of comment spam :( - moderation may take a while.