Which one is faster# DotNet - 窗口里的风景
c*t
1 楼
Given List targets (around 20 elements), how check if string s is in
the list, we have the following ways:
case 1: targets.Contains(s);
case 2: if-else...
case 3: switch ...
case 4: s == e1 || s == e2 || ...
which one is faster?
the list, we have the following ways:
case 1: targets.Contains(s);
case 2: if-else...
case 3: switch ...
case 4: s == e1 || s == e2 || ...
which one is faster?