Class that provides static utility methods for manipulating arrays in Wasabi. Since Wasabi lacks support for generics, these methods are implmented as code generators that produce type specific methods.
Coverts an ICollection into a strongly typed array. Useful for allowing you to build up a list of objects using a .NET collection and then turn it into an array after you’re done with it:
Dim result = Arrays.ArrayFromICollectionInt32(list)
Produces a new array containing only the values that match the supplied predicate:
Dim ys = Arrays.FilterInt32(xs, Lambda (x) x > 0)
Produces a new array containing the result of passing eacy element through a transformation function:
Dim ys = Arrays.MapInt32ToInt32(xs, Lambda (x) x + 1)
HTML encodes the string that’s passed in making it safe fore inclusion as a text node in an HTML document:
<p class="comment"><%= Html.Encode(comment.body) %></p>
Warning
Html.AttributeEncode() does not encode ', or > this means two things:
Replaces ", <, and & with their repective HTML entities making an arbitrary string suitable for use inside an HTML attribute:
<p data-user-name="<%= Html.AttributeEncode(user.name)">...</p>