Best NBi code snippet using NBi.Core.Transformation.Transformer.Native.Text.TextToUpper.AbstractTextLengthTransformation
TextTransformations.cs
Source:TextTransformations.cs  
...82        public TextToSuffix(IScalarResolver<string> suffix)83            : base(suffix) { }84        protected override object EvaluateString(string value) => $"{value}{Append.Execute()}";85    }86    abstract class AbstractTextLengthTransformation : AbstractTextTransformation87    {88        public IScalarResolver<int> Length { get; }89        public AbstractTextLengthTransformation(IScalarResolver<int> length)90            => Length = length;91    }92    class TextToFirstChars : AbstractTextLengthTransformation93    {94        public TextToFirstChars(IScalarResolver<int> length)95            : base(length) { }96        protected override object EvaluateString(string value)97            => value.Length >= Length.Execute() ? value.Substring(0, Length.Execute()) : value;98    }99    class TextToLastChars : AbstractTextLengthTransformation100    {101        public TextToLastChars(IScalarResolver<int> length)102            : base(length) { }103        protected override object EvaluateString(string value)104            => value.Length >= Length.Execute() ? value.Substring(value.Length - Length.Execute(), Length.Execute()) : value;105    }106    class TextToSkipFirstChars : AbstractTextLengthTransformation107    {108        public TextToSkipFirstChars(IScalarResolver<int> length)109            : base(length) { }110        protected override object EvaluateString(string value)111            => value.Length <= Length.Execute() ? "(empty)" : value.Substring(Length.Execute(), value.Length - Length.Execute());112    }113    class TextToSkipLastChars : AbstractTextLengthTransformation114    {115        public TextToSkipLastChars(IScalarResolver<int> length)116            : base(length) { }117        protected override object EvaluateString(string value)118            => value.Length <= Length.Execute() ? "(empty)" : value.Substring(0, value.Length - Length.Execute());119    }120    abstract class AbstractTextPadTransformation : AbstractTextLengthTransformation121    {122        public IScalarResolver<char> Character { get; }123        public AbstractTextPadTransformation(IScalarResolver<int> length, IScalarResolver<char> character)124            : base(length)125            => Character = character;126        protected override object EvaluateEmpty() => new string(Character.Execute(), Length.Execute());127        protected override object EvaluateNull() => new string(Character.Execute(), Length.Execute());128    }129    class TextToPadRight : AbstractTextPadTransformation130    {131        public TextToPadRight(IScalarResolver<int> length, IScalarResolver<char> character)132            : base(length, character) { }133        protected override object EvaluateString(string value)134            => value.Length >= Length.Execute() ? value : value.PadRight(Length.Execute(), Character.Execute());...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
