public void StripBySingleChar() { str_source = "@@%%@ test\tstring @+<>@@@"; ref_Lstrip = "%%@ test\tstring @+<>@@@"; ref_Rstrip = "@@%%@ test\tstring @+<>"; ref_Strip = "%%@ test\tstring @+<>"; char c_target = '@'; NL_source.Clear(); foreach (char c in str_source) { NL_source.Add(c); } SE_source = NL_source.ToStringEntity(); Debug.Log(" >> try NativeList<char>.Lstrip(char, result) >>"); NL_source.Lstrip(c_target, NL_result); Assert.IsTrue(this.CheckStripperResult(NL_result, ref_Lstrip)); Debug.Log(" >> try result = StringEntity.Lstrip(char) >>"); SE_result = SE_source.Lstrip(c_target); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Lstrip)); Debug.Log(" >> try NativeList<char>.Rstrip(char, result) >>"); NL_source.Rstrip(c_target, NL_result); Assert.IsTrue(this.CheckStripperResult(NL_result, ref_Rstrip)); Debug.Log(" >> try result = StringEntity.Rstrip(char) >>"); SE_result = SE_source.Rstrip(c_target); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Rstrip)); Debug.Log(" >> try NativeList<char>.Strip(char, result) >>"); NL_source.Strip(c_target, NL_result); Assert.IsTrue(this.CheckStripperResult(NL_result, ref_Strip)); Debug.Log(" >> try result = StringEntity.Strip(char) >>"); SE_result = SE_source.Strip(c_target); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Strip)); }
public void StripByCharIsWhiteSpace() { str_source = " \t \n something string\tsample \t\t"; ref_Lstrip = "something string\tsample \t\t"; ref_Rstrip = " \t \n something string\tsample"; ref_Strip = "something string\tsample"; NL_source.Clear(); foreach (char c in str_source) { NL_source.Add(c); } SE_source = NL_source.ToStringEntity(); Debug.Log(" >> try NativeList<char>.Lstrip(result) >>"); NL_source.Lstrip(NL_result); Assert.IsTrue(this.CheckStripperResult(NL_result, ref_Lstrip)); Debug.Log(" >> try result = StringEntity.Lstrip() >>"); SE_result = SE_source.Lstrip(); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Lstrip)); Debug.Log(" >> try NativeList<char>.Rstrip(result) >>"); NL_source.Rstrip(NL_result); Assert.IsTrue(this.CheckStripperResult(NL_result, ref_Rstrip)); Debug.Log(" >> try result = StringEntity.Rstrip() >>"); SE_result = SE_source.Rstrip(); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Rstrip)); Debug.Log(" >> try NativeList<char>.Strip(result) >>"); NL_source.Strip(NL_result); Assert.IsTrue(this.CheckStripperResult(NL_result, ref_Strip)); Debug.Log(" >> try result = StringEntity.Strip() >>"); SE_result = SE_source.Strip(); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Strip)); }
public void StripByString() { str_source = "StripperStripperStr$$#ipper test\tstring Stri@%_<pperStripperStripper"; ref_Lstrip = "Str$$#ipper test\tstring Stri@%_<pperStripperStripper"; ref_Rstrip = "StripperStripperStr$$#ipper test\tstring Stri@%_<pper"; ref_Strip = "Str$$#ipper test\tstring Stri@%_<pper"; string str_target = "Stripper"; NL_source.Clear(); foreach (char c in str_source) { NL_source.Add(c); } SE_source = NL_source.ToStringEntity(); var NL_target = new NativeList <char>(Allocator.TempJob); foreach (char c in str_target) { NL_target.Add(c); } var SE_target = NL_target.ToStringEntity(); Debug.Log(" >> try NativeList<char>.Lstrip(NativeList<char>, result) >>"); NL_source.Lstrip(NL_target, NL_result); Assert.IsTrue(this.CheckStripperResult(NL_result, ref_Lstrip)); Debug.Log(" >> try result = StringEntity.Lstrip(NativeList<char>) >>"); SE_result = SE_source.Lstrip(NL_target); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Lstrip)); Debug.Log(" >> try result = StringEntity.Lstrip(StringEntity) >>"); SE_result = SE_source.Lstrip(SE_target); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Lstrip)); Debug.Log(" >> try NativeList<char>.Rstrip(NativeList<char>, result) >>"); NL_source.Rstrip(NL_target, NL_result); Assert.IsTrue(this.CheckStripperResult(NL_result, ref_Rstrip)); Debug.Log(" >> try result = StringEntity.Rstrip(NativeList<char>) >>"); SE_result = SE_source.Rstrip(NL_target); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Rstrip)); Debug.Log(" >> try result = StringEntity.Rstrip(StringEntity) >>"); SE_result = SE_source.Rstrip(SE_target); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Rstrip)); Debug.Log(" >> try NativeList<char>.Strip(NativeList<char>, result) >>"); NL_source.Strip(NL_target, NL_result); Assert.IsTrue(this.CheckStripperResult(NL_result, ref_Strip)); Debug.Log(" >> try result = StringEntity.Strip(NativeList<char>) >>"); SE_result = SE_source.Strip(NL_target); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Strip)); Debug.Log(" >> try result = StringEntity.Strip(StringEntity) >>"); SE_result = SE_source.Strip(SE_target); Assert.IsTrue(this.CheckStripperResult(SE_result, ref_Strip)); NL_target.Dispose(); }