KGy SOFT

StringSegmentSplitOptions Structure

KGy SOFT Core Libraries Help
Specifies options for applicable StringSegment.Split method overloads, such as whether to omit empty substrings from the returned array or trim whitespace from segments.
See the Remarks section for details.

Namespace:  KGySoft.CoreLibraries
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 6.0.0
Syntax

public readonly struct StringSegmentSplitOptions : IEquatable<StringSegmentSplitOptions>

The StringSegmentSplitOptions type exposes the following members.

Methods

  NameDescription
Public methodEquals(Object)
Determines whether the specified object is equal to this instance.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(StringSegmentSplitOptions)
Indicates whether the current StringSegmentSplitOptions instance is equal to another one specified in the other parameter.
Public methodGetHashCode
Returns a hash code for this StringSegmentSplitOptions instance.
(Overrides ValueTypeGetHashCode.)
Public methodToString
Gets the string representation of this StringSegmentSplitOptions instance.
(Overrides ValueTypeToString.)
Top
Operators

  NameDescription
Public operatorStatic memberBitwiseAnd
Performs a bitwise AND operation on the provided operands.
Public operatorStatic memberBitwiseOr
Performs a bitwise OR operation on the provided operands.
Public operatorStatic memberEquality
Determines whether two specified StringSegmentSplitOptions instances have the same value.
Public operatorStatic member(Int32 to StringSegmentSplitOptions)
Performs an explicit conversion from Int32 to StringSegmentSplitOptions.
Public operatorStatic member(StringSegmentSplitOptions to Int32)
Performs an explicit conversion from StringSegmentSplitOptions to Int32.
Public operatorStatic member(StringSegmentSplitOptions to StringSplitOptions)
Performs an explicit conversion from StringSegmentSplitOptions to StringSplitOptions.
Public operatorStatic member(Boolean to StringSegmentSplitOptions) Obsolete.
Performs an implicit conversion from bool to StringSegmentSplitOptions.
This member is obsolete and is specified to provide compatibility with the old StringSegment.Split overloads, which used to specify a boolean removeEmptyEntries argument in place of the new StringSegmentSplitOptions type.
Public operatorStatic member(StringSplitOptions to StringSegmentSplitOptions)
Performs an implicit conversion from StringSplitOptions to StringSegmentSplitOptions.
Public operatorStatic memberInequality
Determines whether two specified StringSegmentSplitOptions instances have different values.
Public operatorStatic memberOnesComplement
Performs a bitwise NOT operation on the specified value.
Top
Fields

  NameDescription
Public fieldStatic memberNone
Represents the default options when splitting string segments by the Split method overloads.
Public fieldStatic memberRemoveEmptyEntries
Omits elements that contain an empty string segment from the result. When combined with the TrimEntries option, then whitespace-only segments will also be omitted.
Public fieldStatic memberTrimEntries
Trims white-space characters from each string segment in the result. When combined with the RemoveEmptyEntries option, then whitespace-only segments will also be omitted.
Top
Extension Methods

  NameDescription
Public Extension MethodConvert(Type, CultureInfo)Overloaded.
Converts an Object specified in the obj parameter to the desired targetType.
See the Examples section of the generic ConvertTTarget(Object, CultureInfo) overload for an example.
(Defined by ObjectExtensions.)
Public Extension MethodCode exampleConvertTTarget(CultureInfo)Overloaded.
Converts an Object specified in the obj parameter to the desired TTarget.
See the Remarks section for details.
(Defined by ObjectExtensions.)
Public Extension MethodIn (Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, CultureInfo, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvertTTarget(TTarget)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvertTTarget(CultureInfo, TTarget)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Top
Remarks

The StringSegmentSplitOptions is specified as a struct rather than an enum, so it can be compatible both with StringSplitOptions and the old StringSegment.Split methods that defined a simple bool removeEmptyEntries parameter as options.

Unlike StringSplitOptions, this struct defines the TrimEntries option for all platform targets.

See Also

Reference