当前位置: 首页>>代码示例>>C#>>正文


C# StringScanner.Match方法代码示例

本文整理汇总了C#中IronRuby.StandardLibrary.StringScanner.StringScanner.Match方法的典型用法代码示例。如果您正苦于以下问题:C# StringScanner.Match方法的具体用法?C# StringScanner.Match怎么用?C# StringScanner.Match使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IronRuby.StandardLibrary.StringScanner.StringScanner的用法示例。


在下文中一共展示了StringScanner.Match方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SearchFull

 public static object SearchFull(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern, bool advancePointer, bool returnString)
 {
     bool match = self.Match(pattern, false, advancePointer);
     if (match) {
         int length = self.LastMatch.Length + (self.FoundPosition - self.PreviousPosition);
         if (returnString) {
             return self.ScanString.GetSlice(self.PreviousPosition, length);
         } else {
             return ScriptingRuntimeHelpers.Int32ToObject(length);
         }
     }
     return null;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:13,代码来源:StringScanner.cs

示例2: SkipUntil

 public static int? SkipUntil(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern)
 {
     bool match = self.Match(pattern, false, true);
     if (!match) {
         return null;
     }
     return (self.CurrentPosition - self.PreviousPosition);
 }
开发者ID:TerabyteX,项目名称:main,代码行数:8,代码来源:StringScanner.cs

示例3: ScanFull

 public static object ScanFull(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern, bool advancePointer, bool returnString)
 {
     bool match = self.Match(pattern, true, advancePointer);
     if (match) {
         if (returnString) {
             return MutableString.Create(self.LastMatch);
         } else {
             return ScriptingRuntimeHelpers.Int32ToObject(self.LastMatch.Length);
         }
     }
     return null;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:12,代码来源:StringScanner.cs

示例4: Match

 public static int? Match(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern)
 {
     if (!self.Match(pattern, true, false)) {
         return null;
     }
     return self.LastMatch.GetLength();
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:StringScanner.cs

示例5: Exist

 public static int? Exist(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern)
 {
     if (!self.Match(pattern, false, false)) {
         return null;
     }
     return self.FoundPosition + self.LastMatch.Length;
 }
开发者ID:TerabyteX,项目名称:main,代码行数:7,代码来源:StringScanner.cs

示例6: SearchFull

 public static object SearchFull(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern, bool advance_pointer_p, bool return_string_p) {
     bool match = self.Match(pattern, false, advance_pointer_p);
     object result = null;
     if (match) {
         int length = self.LastMatch.Length + (self.FoundPosition - self.PreviousPosition);
         if (return_string_p) {
             result = self.ScanString.GetSlice(self.PreviousPosition, length);
         } else {
             result = length;
         }
     }
     return result;
 }
开发者ID:Hank923,项目名称:ironruby,代码行数:13,代码来源:StringScanner.cs

示例7: ScanFull

 public static object ScanFull(StringScanner/*!*/ self, [NotNull]RubyRegex/*!*/ pattern, bool advance_pointer_p, bool return_string_p) {
     bool match = self.Match(pattern, true, advance_pointer_p);
     object result = null;
     if (match) {
         if (return_string_p) {
             result = MutableString.Create(self.LastMatch);
         } else {
             result = self.LastMatch.Length;
         }
     }
     return result;
 }
开发者ID:Hank923,项目名称:ironruby,代码行数:12,代码来源:StringScanner.cs


注:本文中的IronRuby.StandardLibrary.StringScanner.StringScanner.Match方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。