More Literal fun! Adding text question

Ok, I know how to add text to a literal with the
myliteral.Text = “blah blah”

but what if I have that and I want to add something before “blah blah”? what statement would I use?

Does my question make sense?

do you mean setting html as text?

Nope, sorry I wasn’t clear.

If the text value of the literal is

“Blah Blah” and I want it to be
“This is my Blah Blah”, how do I do that?

I know how to add text to the end, but how to add to the beginning.

^ Better suggestion. I would imagine that’s a more efficient use of resources.

String.Format("This is my {0}", myLiteral.Text);

Assuming myLiteral.Text is Blah Blah

myLiteral.Text = "This is my " & myLiteral.Text

will output:

This is my Blah Blah

Awesome!! Thank you :slight_smile:

I had thought of doing it the way FFcus suggested but just somehow felt there must be a more elegant solution.

How long is the text in this literal?

Well, I found what I think is a better answer to my question, which is that the literal should be built using a string builder, then I can use the myStringBuilder.Insert to place the info at the beginning just before I write the stringbuilder to the literal.

But the other solutions are probably great for other cases!

Hi, Sorry it took so long for me to respond. The text isn’t horribly long. It is the product detail, so it is just several paragraphs of information pulled from a few different places and put together/formatted.

A string might have been just as or more efficient.