#C#, 93 bytes#
n=>{var s=n>0?new string('-',n+1):"";while(n-->0)s="|"+new string(' ',n)+"\\\n"+s;return s;}; Anonymous function which returns the ASCII triangle as a string.
Full program with ungolfed, commented function and test cases:
using System; class ASCIITriangles { static void Main() { Func<int, string> f = n => { // creates the triangle's bottom, made of dashes // or an empty string if n == 0 var s = n > 0 ? new string('-', n + 1) : ""; // a bottom to top process while ( n-- > 0) // that creates each precedent line s = "|" + new string(' ', n) + "\\\n" + s; // and returns the resulting ASCII art return s; }; // test cases: Console.WriteLine(f(4)); Console.WriteLine(f(0)); Console.WriteLine(f(1)); } }