@inherits Custom.Hybrid.Razor14
@using ToSic.Razor.Blade;
<!-- unimportant stuff, hidden -->
RazorBlade Text.First(...) v3 These... <!-- unimportant stuff, hidden -->
@{
var val1 = "John";
var val2 = "Michael";
var spc = " ";
var fallback = "please-enter-name";
var nbsp = " ";
}
Demos Basic 2-Value Demos
<ol>
<li>
<code>Text.First(null, @val1)</code>
⇒ @Text.First(null, val1)
</li>
<li>
<code>Text.First(null, null)</code>
⇒ @Text.First(null, null)
</li>
<li>
<code>Text.First(@val1, @val2)</code>
⇒ @Text.First(val1, val2)
</li>
<li>
<code>Text.First("@spc" = 3 spaces, @val1)</code>
⇒ @Text.First(spc, val1)
</li>
<li>
<code>Text.First(null, @fallback)</code>
⇒ @Text.First(null, fallback)
</li>
<li>
<code>Text.First(@nbsp, @fallback)</code>
⇒ @Text.First(nbsp, fallback)
</li>
<li>
<code>Text.First(false, @nbsp, @fallback)</code>
⇒ @Text.First(false, nbsp, fallback) <br>
<em></em>"false" at the end means don't treat html-whitespace as whitespace, so @nbsp will be treated as a real value</em>
</li>
</ol>
3-5 Value Demos Text.First has overloads... <!-- unimportant stuff, hidden -->
<ol>
<li>
<code>Text.First(null, @val1, @fallback)</code>
⇒ @Text.First(null, val1, fallback)
</li>
<li>
<code>Text.First(null, @val1, @val2, @fallback)</code>
⇒ @Text.First(null, val1, val2, fallback)
</li>
<li>
<code>Text.First(null, @nbsp, @val1, @val2, @fallback)</code>
⇒ @Text.First(null, nbsp, val1, val2, fallback)
</li>
<li>
<code>Text.First(false, null, @nbsp, @val1, @val2, @fallback)</code>
⇒ @Text.First(false, null, nbsp, val1, val2, fallback)
</li>
<li>
<code>Text.First(null, null, @nbsp, @val1, @val2, "@spc", @fallback)</code>
⇒ @Text.First(null, null, nbsp, val1, val2, spc, fallback)
</li>
<li>
<code>Text.First(false, null, null, @nbsp, @val1, @val2, "@spc", @fallback)</code>
⇒ @Text.First(false, null, null, nbsp, val1, val2, spc, fallback)
</li>
</ol>
<!-- unimportant stuff, hidden -->