String.Format and Curley Braces
- From: "AMDRIT" <amdrit@xxxxxxxxxxx>
- Date: Mon, 10 Oct 2005 17:21:30 -0500
Hello all,
I am trying my hand at RegEx and came across a tangent; curley braces upset
string.format expressions. Is there a way to escape them with out making
them an argument?
strTemp = string.format("This is my string }{") =Exception thrown
strTemp = string.format("This is my string {0}{1}","}"."{") = This is my
test string }{
my reason for useage:
Allow any alphanemeric value x to x+n times where x and x+n are passed in
values
string.format("\b[a-zA-Z0-9]{{0},{1}}\b", MinLen, MaxLen)
becomes
string.format("\b[a-zA-Z0-9]{0}{1},{2}{3}}\b","{", MinLen, MaxLen, "}")
Thanks
.
- Follow-Ups:
- Re: String.Format and Curley Braces
- From: Jon Skeet [C# MVP]
- Re: String.Format and Curley Braces
- Prev by Date: SourceSafe
- Next by Date: Re: String.Format and Curley Braces
- Previous by thread: SourceSafe
- Next by thread: Re: String.Format and Curley Braces
- Index(es):
Relevant Pages
|