Argentini.Halide.H3Text.Crop C# (CSharp) Method

Crop() public static method

Return the current string cropped by number of words or characters.

Words: returns the first "xNumber" of words in the string, including any intermediate punctuation, etc. Trailing punctuation is always removed.

Characters: returns the first "xNumber" of characters in the string, including any intermediate punctuation, etc. When it locates the last character, it scans ahead to make sure it's not breaking a word. If it is in the middle of a word, it will skip ahead to the next non-alpha-numeric chatacter and break on that, so your cropped string may be slightly larger than the number of characters you requested. Trailing punctuation is always removed.

public static Crop ( string strVar, int xNumber, CropType cropType ) : String
strVar string String to process.
xNumber int Number of words or characters to return (as close as possible).
cropType CropType Enum value: CropType.Characters or CropType.Words.
return String
        public static String Crop(string strVar, int xNumber, CropType cropType)
        {
            return Crop(strVar, xNumber, cropType, "", "");
        }

Same methods

H3Text::Crop ( string strVar, int xNumber, CropType cropType, string xChars ) : String
H3Text::Crop ( string strVar, int xNumber, CropType cropType, string xChars, string endWhenCropped ) : String