A
Andrew
I am a newbie to C# and would appreciate any help converting the
following javascript function to C#
function fxnParseIt() {
// Note: sInputString code for demo purposes only, and should be
// replaced with user's code for getting in string value.
var sInputString = 'asp and database';
sText = sInputString;
sText = sText.replace(/"/g,"");
if (sText.search(/(formsof|near|isabout)/i) == -1) {
sText = sText.replace(/ (and not|and) /gi,'" $1 "');
sText = sText.replace(/ (or not|or) /gi,'" $1 "');
sText = '"' + sText + '"';
}
sInputString = sText;
}
Many Thanks
following javascript function to C#
function fxnParseIt() {
// Note: sInputString code for demo purposes only, and should be
// replaced with user's code for getting in string value.
var sInputString = 'asp and database';
sText = sInputString;
sText = sText.replace(/"/g,"");
if (sText.search(/(formsof|near|isabout)/i) == -1) {
sText = sText.replace(/ (and not|and) /gi,'" $1 "');
sText = sText.replace(/ (or not|or) /gi,'" $1 "');
sText = '"' + sText + '"';
}
sInputString = sText;
}
Many Thanks