regex help (how to match string with potential spaces or not)

  • Thread starter Thread starter titan nyquist
  • Start date Start date
T

titan nyquist

how can i match a string, of unknown length, when it may OR MAY NOT
contain spaces?

for example, these should all match "testing":

testing
test ing
t esting
t e s t i n g

i'm not sure how to set the regex... any help is appreciated

~titan
 
Hi,

What about if you simply remove the spaces BEFORE matching it?

string s= "t e s t".Replace(" ","");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top