Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // ********************************
- // Created by Emy sáez. on 24/05/19.
- // Copyright (C) Spectrus 2019. All rights reserved.
- // ********************************
- //
- using System;
- using System.Linq;
- namespace test
- {
- public class ExampleLinq
- {
- // expresión linq
- public static bool ContainsExtension(string path)
- {
- bool result = extensions.Count<String>(x => path.Contains(x)) == 1 ? true : false; // si path contiene 1 extensión
- return result;
- }
- private String[] extensions = new String[]
- {
- ".png",
- ".jpg",
- ".bmp",
- ".gif"
- };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement