diff Tools/DocGen/Content/Doc/Data/LinqStringFunctions.txt @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tools/DocGen/Content/Doc/Data/LinqStringFunctions.txt	Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,24 @@
+* All data providers
+| Length      | s.Length               | Sql.Length(s)
+| Substring   | s.Substring  (a)       | Sql.Substring(s, a + 1, Sql.Length(s) - a)
+| Substring   | s.Substring  (a, b)    | Sql.Substring(s, a + 1, b)
+| IndexOf     | s.IndexOf    (a)       | Sql.Length(a) == 0 ? 0  : (Sql.CharIndex(a, s) ?? 0) - 1
+| IndexOf     | s.IndexOf    (a, b)    | Sql.Length(a) == 0 && Sql.Length(s) > b ? b : (Sql.CharIndex(a, s, b + 1) ?? 0) - 1
+| IndexOf     | s.IndexOf    (a, b, c) | Sql.Length(a) == 0 && Sql.Length(s) > b ? b : (Sql.CharIndex(a, Sql.Left(s, c), b) ?? 0) - 1
+| LastIndexOf | s.LastIndexOf(a)       | Sql.Length(a) == 0 ? Sql.Length(s) - 1 :<br>(Sql.CharIndex(a, s) ?? 0) == 0 ? -1 :<br>&nbsp;&nbsp;Sql.Length(s) - (Sql.CharIndex(Sql.Reverse(a), Sql.Reverse(s)) ?? 0) - Sql.Length(a) + 1
+| LastIndexOf | s.LastIndexOf(a, b)    | Sql.Length(a) == 0 ? b :<br>(Sql.CharIndex(a, s, b + 1) ?? 0) == 0 ? -1 :<br>&nbsp;&nbsp;Sql.Length(s) - (Sql.CharIndex(Sql.Reverse(a), Sql.Reverse(Sql.Substring(s, b + 1, Sql.Length(s) - b))) ?? 0) - Sql.Length(a) + 1
+| LastIndexOf | s.LastIndexOf(a, b, c) | Sql.Length(a) == 0 ? b :<br>(Sql.CharIndex(a, Sql.Left(s, b + c), b + 1) ?? 0) == 0 ? -1 :<br>&nbsp;&nbsp;b + c - (Sql.CharIndex(Sql.Reverse(a), Sql.Reverse(Sql.Substring(s, b + 1, c))) ?? 0) - Sql.Length(a) + 1
+| Insert      | s.Insert     (a, b)    | Sql.Length(s) == a ? s + b : Sql.Stuff(s, a + 1, 0, b)
+| Remove      | s.Remove     (a)       | Sql.Left(s, a)
+| Remove      | s.Remove     (a, b)    | Sql.Stuff(s, a + 1, b, "")
+| Pad         | s.PadLeft    (a)       | Sql.PadLeft(s, a, ' ')
+| Pad         | s.PadLeft    (a, b)    | Sql.PadLeft(s, a, b)
+| Pad         | s.PadRight   (a)       | Sql.PadRight(s, a, ' ')
+| Pad         | s.PadRight   (a, b)    | Sql.PadRight(s, a, b)
+| Replace     | s.Replace    (a, b)    | Sql.Replace(s, a, b)
+| Trim        | s.Trim       ()        | Sql.Trim(s)
+| Trim        | s.TrimEnd    ()        | Sql.TrimRight(s)
+| Trim        | s.TrimStart  ()        | Sql.TrimLeft(s)
+| Case        | s.ToLower    ()        | Sql.Lower(s)
+| Case        | s.ToUpper    ()        | Sql.Upper(s)
+| Compare     | s.CompareTo  (a)       | s > a ? 1 : s == 0 ? 0 : -1