Link to home
Start Free TrialLog in
Avatar of MrTV
MrTVFlag for Thailand

asked on

c# add name space

my from1 need to add name space into it how can i add it

                    CoderBuddy.ExtractEmails helper = new CoderBuddy.ExtractEmails(result);
                    EmailsList = helper.Extract_Emails;

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace Coderbuddy
public class ExtractEmails
private string s;
public ExtractEmails(string Text2Scrape)
this.s = Text2Scrape;
public string[] Extract_Emails()
string[] Email_List = new string[0];
Regex r = new Regex(@"[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}", RegexOptions.IgnoreCase);
Match m;
//Searching for the text that matches the above regular expression(which only matches email addresses)
for (m = r.Match(s); m.Success; m = m.NextMatch())
//This section here demonstartes Dynamic arrays
if (m.Value.Length > 0)
//Resize the array Email_List by incrementing it by 1, to save the next result
Array.Resize(ref Email_List, Email_List.Length + 1);
Email_List[Email_List.Length - 1] = m.Value;
return Email_List;

Open in new window

Avatar of AndyAinscow
Flag of Switzerland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial