这段代码很有效 [英] This code is efficient
问题描述
你好,这段代码有效吗?
公共静态字符串HTML_FASE1_OTROS_GENERAL =
" < table id =''tFase1''cellspacing =''0''cellpadding ='''''width ='''800''>" +
" < TR>" +
" < td width ='''15''>< / td>" +
" < td width ='''750''>< br>" +
.............
谢谢
Hello, Is this code efficient?
public static string HTML_FASE1_OTROS_GENERAL =
" <table id=''tFase1'' cellspacing=''0'' cellpadding=''0'' width=''800'' >" +
" <tr>" +
" <td width=''15''></td>" +
" <td width=''750''><br>" +
.............
Thanks
推荐答案
>你好,这段代码有效吗?
> Hello, Is this code efficient?
公共静态字符串HTML_FASE1_OTROS_GENERAL =
" < table id =''tFase1''cellspacing =''0''cellpadding ='''''width ='''800''>" +
< TR>" +
< td width ='''15''>< / td>" +
< td width ='''750''>< br>" +
............
谢谢
public static string HTML_FASE1_OTROS_GENERAL =
" <table id=''tFase1'' cellspacing=''0'' cellpadding=''0'' width=''800'' >" +
" <tr>" +
" <td width=''15''></td>" +
" <td width=''750''><br>" +
............
Thanks
no ..你会想要使用一个字符串构建器或
公共静态字符串HTML_FASE1_OTROS_GENERAL = @" < table id =''tFase1'' cellssacing =''0''
cellpadding =''0''width =''800''>
< ; tr>
< td width =''15''>< / td>
< td width =''750''>< BR>" ;
类似的东西..那样你就不会创建多个
字符串的实例..并浪费内存..
no.. you''ll want to use a string builder or
public static string HTML_FASE1_OTROS_GENERAL = @" <table id=''tFase1'' cellspacing=''0''
cellpadding=''0'' width=''800'' >
<tr>
<td width=''15''></td>
<td width=''750''><br>" ;
something like that.. that way the you don''t create multiple instances of
string.. and waste memory..
Fran,
除非这个改变很好,否则我会让它保持不变,如果没有,那么
只读,除非你有理由希望其他人改变它吗?
你不必担心多个字符串。编译器将
减少到一个字符串。
希望这会有所帮助。
-
- Nicholas Paldino [.NET / C#MVP]
- mv*@spam.guard.caspershouse.com
" fran" < FR ** @ discussions.microsoft.com>在留言中写道
新闻:E2 ********************************** @ microsof t.com ...
Fran,
Unless this changes a good deal, I would make it constant, if not, then
read-only, unless you have a reason you want other people to change it?
You don''t have to worry about the multiple strings. The compiler will
reduce that to one string.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"fran" <fr**@discussions.microsoft.com> wrote in message
news:E2**********************************@microsof t.com...
你好,这段代码有效吗?
公共静态字符串HTML_FASE1_OTROS_GENERAL =
" < table id =''tFase1''cellspacing =''0''cellpadding ='''''width ='''800''>" +
< TR>" +
< td width ='''15''>< / td>" +
< td width ='''750''>< br>" +
............
谢谢
Hello, Is this code efficient?
public static string HTML_FASE1_OTROS_GENERAL =
" <table id=''tFase1'' cellspacing=''0'' cellpadding=''0'' width=''800'' >" +
" <tr>" +
" <td width=''15''></td>" +
" <td width=''750''><br>" +
............
Thanks
效率不高。
-
HTH,
Kevin Spencer
Microsoft MVP
..Net开发商
你可以把鱼带到自行车上,
但需要很长时间,
和自行车必须*要*改变。
" fran" < FR ** @ discussions.microsoft.com>在留言中写道
新闻:E2 ********************************** @ microsof t.com ...
It is not inefficient.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
"fran" <fr**@discussions.microsoft.com> wrote in message
news:E2**********************************@microsof t.com...
你好,这段代码有效吗?
公共静态字符串HTML_FASE1_OTROS_GENERAL =
" < table id =''tFase1''cellspacing =''0''cellpadding ='''''width ='''800''>" +
< TR>" +
< td width ='''15''>< / td>" +
< td width ='''750''>< br>" +
............
谢谢
Hello, Is this code efficient?
public static string HTML_FASE1_OTROS_GENERAL =
" <table id=''tFase1'' cellspacing=''0'' cellpadding=''0'' width=''800'' >" +
" <tr>" +
" <td width=''15''></td>" +
" <td width=''750''><br>" +
............
Thanks
这篇关于这段代码很有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!