コード例 #1
0
 /// <summary>
 /// Removes all trailing white-space characters from the memory.
 /// </summary>
 /// <param name="memory">The source memory from which the characters are removed.</param>
 public static Memory <char> TrimEnd(this Memory <char> memory)
 => memory.Slice(0, ClampEnd(memory.Span, 0));
コード例 #2
0
 /// <summary>
 /// Removes all trailing occurrences of a specified element from the memory.
 /// </summary>
 /// <param name="memory">The source memory from which the element is removed.</param>
 /// <param name="trimElement">The specified element to look for and remove.</param>
 public static Memory <T> TrimEnd <T>(this Memory <T> memory, T trimElement) where T : IEquatable <T>
 => memory.Slice(0, ClampEnd(memory.Span, 0, trimElement));
コード例 #3
0
 /// <summary>
 /// Removes all leading white-space characters from the memory.
 /// </summary>
 /// <param name="memory">The source memory from which the characters are removed.</param>
 public static Memory <char> TrimStart(this Memory <char> memory)
 => memory.Slice(ClampStart(memory.Span));
コード例 #4
0
 /// <summary>
 /// Removes all leading occurrences of a specified element from the memory.
 /// </summary>
 /// <param name="memory">The source memory from which the element is removed.</param>
 /// <param name="trimElement">The specified element to look for and remove.</param>
 public static Memory <T> TrimStart <T>(this Memory <T> memory, T trimElement) where T : IEquatable <T>
 => memory.Slice(ClampStart(memory.Span, trimElement));