I have a This works fine but if I have a file name that is made up of i's vs. W's then the div will have unused space on the right. For example: "iiiiiiiiii.jpg" is shorter than: "WWWWWWWWWW.jpg" ...even though they have the same number of characters. Is there a better way to do this that accounts for the length of the Thank you, Aaron<div id="fileName" class="field-row" title="<%= fileName %>">
<% if(fileName.Length > 20) { %>
Filename: <%= fileName.Substring(0,20) %>...
<% } else { %>
Filename: <%= fileName %>
<% } %>
</div>
0 ответов
Похожие вопросы: