glz
06-24-2008, 04:59 PM
Error: syntax error
Line: 26, Column: 30
Source Code:
text = Regex.Replace(text, @"\s+", "");
----------------------------^
also tried:
text = Regex.Replace(text, @'\s+', '');
Here's full source:
function getCharDimArr(text, font, fontSizeStr, measureBox) {
//remove all spaces from text
try {
text = Regex.Replace(text, @'\s+', '');
} catch (ArgumentException ex) {
alert('Syntax error in the regular expression in removing spaces in getCharWH() func');
}
I got the code verbatim from RegexBuddy, how can I fix syntax error?
\s+ is regex shorthand for all space characters.
-thanks http://bstats.freehostia.com/b.gif
Line: 26, Column: 30
Source Code:
text = Regex.Replace(text, @"\s+", "");
----------------------------^
also tried:
text = Regex.Replace(text, @'\s+', '');
Here's full source:
function getCharDimArr(text, font, fontSizeStr, measureBox) {
//remove all spaces from text
try {
text = Regex.Replace(text, @'\s+', '');
} catch (ArgumentException ex) {
alert('Syntax error in the regular expression in removing spaces in getCharWH() func');
}
I got the code verbatim from RegexBuddy, how can I fix syntax error?
\s+ is regex shorthand for all space characters.
-thanks http://bstats.freehostia.com/b.gif