You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: FAST.FBasicInterpreter/Libraries/FBasicTextReplacer.cs
+76-2Lines changed: 76 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,8 @@
15
15
/// pcase(string) :: Converts the string to Proper Case (first letter upper rest lower)
16
16
/// words(s, 1) :: counts the number of words in a string s that are at least 1 character long. if the input string is empty returns 0, if the minWordSize is less than 1 it is set to 1. The word delimiters are space, tab, newline and carriage-return. Consequent delimiters are treated as one.
17
17
/// phtoname(s) :: from a placeholder keeps only the variable name (simple or squear bracket)
18
-
18
+
/// singlewhite(s) :: return the input string without duplicate white spaces (newlines etc).
19
+
///
19
20
20
21
///
21
22
/// Placeholders are defined as {name}, where name is the name of a variable.
@@ -36,6 +37,12 @@
36
37
/// </summary>
37
38
publicclassFBasicTextReplacer:IFBasicLibrary
38
39
{
40
+
// We can pre-compile the Regex for better performance if this method
41
+
// is called very frequently. For .NET 7+, we can use [GeneratedRegex].
42
+
// For a simple static method, Regex.Replace is clear and efficient.
0 commit comments