c# - Multiple Numbers of var possible? -
How can I add multiple var to this code?
var trimchars = "ab"; I want to add a sample:
"ab", "as", "ab", "as" Is it possible?
Tells some of my code even more:
if (e.KeyCode == Keys.Enter) {string Slb = lb.SelectedText .tar (); Var trimChars = "ab"; Var Trimmed = Slab TrimStart (Trim Chars.ToCharArray ()); RTB. Selected text = sorting; Lb.Hide (); } Thanks in advance and sorry for this newbie question :). More power!
You can use the strings from the beginning: -
Public string RemoveFromStart (string s, ienumerable & lt; string & gt; string) {foreach (with x start in x string)) {return s. Remove (0, X. Lang)} Return S; } and
var x = RemoveFromStart ("ablah", new [] {"ab", "as", "ab", "like "}); or with your code
var trimmed = RemoveFromStart (slab, new string [] {"ab", "as", "ab", "Like"});
Comments
Post a Comment