Main Site Documentation

Trim does not work


#1

This code does not work:

                tmp = "08:45:01";
                char[] trimchars = { ':', '/' };
                tmp = tmp.Trim(trimchars);

tmp is unchanged -> ( “08:45:01” )


#2

Doesn’t Trim() eliminate leading and trailing characters?
?


#3

That is correct (i am corrected). Trim does all leading AND trailing occurences. TrimStart does ALL leading occurences, TrimEnd does ALL trailing occurences.

The method I needed is Replace(’:’,’’), which is not included in TinyCLR (yet??)


#4

Correct, replace is not present today.