File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed
Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ Class constructor($inName : Text; $inAddress : Text)
1212 This .fromString ($inName )
1313 Else
1414
15- This .name := Trim ($inName )
16- This .email := Trim ($inAddress )
15+ This .name := cs . _Tools . me . trimSpaces ($inName )
16+ This .email := cs . _Tools . me . trimSpaces ($inAddress )
1717 End case
1818
1919
@@ -28,11 +28,11 @@ Function fromString($inValue : Text)
2828
2929 If (($startMailPos> 0) && ($endMailPos> $startMailPos))
3030
31- This .name := Trim (Substring ($inValue ; 1 ; $startMailPos - 1 ))
32- This .email := Trim (Substring ($inValue ; $startMailPos + 1 ; $endMailPos - $startMailPos - 1 ))
31+ This .name := cs . _Tools . me . trimSpaces (Substring ($inValue ; 1 ; $startMailPos - 1 ))
32+ This .email := cs . _Tools . me . trimSpaces (Substring ($inValue ; $startMailPos + 1 ; $endMailPos - $startMailPos - 1 ))
3333 Else
3434
35- var $email : Text:= Trim ($inValue )
35+ var $email : Text:= cs . _Tools . me . trimSpaces ($inValue )
3636 If (cs ._Tools .me .isValidEmail ($email ))
3737 This .email := $email
3838 End if
Original file line number Diff line number Diff line change @@ -458,6 +458,25 @@ Function stopWebServer() : Boolean
458458 // ----------------------------------------------------
459459
460460
461+ Function trimSpaces ($inText : Text) : Text
462+
463+ var $startPos : Integer:= 1
464+ var $endPos : Integer:= Length ($inText )
465+
466+ While (($startPos<= $endPos) && ($inText[[$startPos ]]= " "))
467+ $startPos + = 1
468+ End while
469+
470+ While (($endPos>= $startPos) && ($inText[[$endPos ]]= " "))
471+ $endPos - = 1
472+ End while
473+
474+ return Substring ($inText ; $startPos ; $endPos - $startPos + 1 )
475+
476+
477+ // ----------------------------------------------------
478+
479+
461480Function urlDecode ($inURL : Text) : Text
462481
463482/*
You can’t perform that action at this time.
0 commit comments