替换字符串c#中的值不起作用

时间:2011-04-14 20:35:53

标签: c# string

            <tbody><tr class="ind_calc_preview_schedule_header">
                <td id="fixedStartDate" class="resultsSubHeader">
                    Fixed Start 
                </td>
                <td id="fixedEndDate" class="resultsSubHeader">
                    Fixed End 
                </td>
                <td style="display: none;" id="floatingStartDate" class="resultsSubHeader">
                    Floating Start                         
                </td>
                <td style="display: none;" id="floatingEndDate" class="resultsSubHeader">
                    Floating End
                </td>
                <td class="resultsSubHeader">
                    Notional
                </td>
                <td class="resultsSubHeader">
                    Drop
                </td>
            </tr>
        <tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Apr-2011</td><td class="ind_calc_date_column">16-May-2011</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">16-May-2011</td><td class="ind_calc_date_column">14-Jun-2011</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Jun-2011</td><td class="ind_calc_date_column">14-Jul-2011</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Jul-2011</td><td class="ind_calc_date_column">15-Aug-2011</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">15-Aug-2011</td><td class="ind_calc_date_column">14-Sep-2011</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Sep-2011</td><td class="ind_calc_date_column">14-Oct-2011</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Oct-2011</td><td class="ind_calc_date_column">14-Nov-2011</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Nov-2011</td><td class="ind_calc_date_column">14-Dec-2011</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Dec-2011</td><td class="ind_calc_date_column">17-Jan-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">17-Jan-2012</td><td class="ind_calc_date_column">14-Feb-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Feb-2012</td><td class="ind_calc_date_column">14-Mar-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Mar-2012</td><td class="ind_calc_date_column">16-Apr-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">16-Apr-2012</td><td class="ind_calc_date_column">14-May-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-May-2012</td><td class="ind_calc_date_column">14-Jun-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Jun-2012</td><td class="ind_calc_date_column">16-Jul-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">16-Jul-2012</td><td class="ind_calc_date_column">14-Aug-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Aug-2012</td><td class="ind_calc_date_column">14-Sep-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Sep-2012</td><td class="ind_calc_date_column">15-Oct-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">15-Oct-2012</td><td class="ind_calc_date_column">14-Nov-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Nov-2012</td><td class="ind_calc_date_column">14-Dec-2012</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Dec-2012</td><td class="ind_calc_date_column">14-Jan-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Jan-2013</td><td class="ind_calc_date_column">14-Feb-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Feb-2013</td><td class="ind_calc_date_column">14-Mar-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Mar-2013</td><td class="ind_calc_date_column">15-Apr-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">15-Apr-2013</td><td class="ind_calc_date_column">14-May-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-May-2013</td><td class="ind_calc_date_column">14-Jun-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Jun-2013</td><td class="ind_calc_date_column">15-Jul-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">15-Jul-2013</td><td class="ind_calc_date_column">14-Aug-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Aug-2013</td><td class="ind_calc_date_column">16-Sep-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">16-Sep-2013</td><td class="ind_calc_date_column">15-Oct-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">15-Oct-2013</td><td class="ind_calc_date_column">14-Nov-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Nov-2013</td><td class="ind_calc_date_column">16-Dec-2013</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">16-Dec-2013</td><td class="ind_calc_date_column">14-Jan-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Jan-2014</td><td class="ind_calc_date_column">14-Feb-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Feb-2014</td><td class="ind_calc_date_column">14-Mar-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Mar-2014</td><td class="ind_calc_date_column">14-Apr-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Apr-2014</td><td class="ind_calc_date_column">14-May-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-May-2014</td><td class="ind_calc_date_column">16-Jun-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">16-Jun-2014</td><td class="ind_calc_date_column">14-Jul-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Jul-2014</td><td class="ind_calc_date_column">14-Aug-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Aug-2014</td><td class="ind_calc_date_column">15-Sep-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">15-Sep-2014</td><td class="ind_calc_date_column">14-Oct-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Oct-2014</td><td class="ind_calc_date_column">14-Nov-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Nov-2014</td><td class="ind_calc_date_column">15-Dec-2014</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">15-Dec-2014</td><td class="ind_calc_date_column">14-Jan-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Jan-2015</td><td class="ind_calc_date_column">17-Feb-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">17-Feb-2015</td><td class="ind_calc_date_column">16-Mar-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">16-Mar-2015</td><td class="ind_calc_date_column">14-Apr-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Apr-2015</td><td class="ind_calc_date_column">14-May-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-May-2015</td><td class="ind_calc_date_column">15-Jun-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">15-Jun-2015</td><td class="ind_calc_date_column">14-Jul-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Jul-2015</td><td class="ind_calc_date_column">14-Aug-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Aug-2015</td><td class="ind_calc_date_column">14-Sep-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Sep-2015</td><td class="ind_calc_date_column">14-Oct-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Oct-2015</td><td class="ind_calc_date_column">16-Nov-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">16-Nov-2015</td><td class="ind_calc_date_column">14-Dec-2015</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Dec-2015</td><td class="ind_calc_date_column">14-Jan-2016</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Jan-2016</td><td class="ind_calc_date_column">16-Feb-2016</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">16-Feb-2016</td><td class="ind_calc_date_column">14-Mar-2016</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr><tr class="ind_calc_preview_schedule_row amortizationschedulepreviewrow"><td class="ind_calc_date_column">14-Mar-2016</td><td class="ind_calc_date_column">14-Apr-2016</td><td class="ind_calc_curr_column">$10,000,000.00</td><td class="ind_calc_curr_column">$0.00</td></tr></tbody>

所以这实际上是我在c#中的一个字符串,我想用tbody替换table,所以我试图这样做:

_viewPath.Replace("tbody", "table");

但它不起作用。为什么呢?

5 个答案:

答案 0 :(得分:7)

你应该这样做:

_viewPath = _viewPath.Replace("tbody", "table");

答案 1 :(得分:3)

因为string.Replace不修改字符串,所以它返回一个新字符串

_viewPath = _viewPath.Replace("tbody", "table");

会做到这一点。

答案 2 :(得分:1)

字符串是不可变的。这意味着你不要修改它们 - .Replace返回一个新字符串。试试这个:

_viewPath = _viewpath.Replace("tbody", "table");

答案 3 :(得分:0)

您应该保存替换结果:_viewPath = _viewPath.Replace("tbody", "table");

答案 4 :(得分:0)

Replace实际上是功能返回结果。你必须这样做:

var Result = _viewPath.Replace("tbody", "table");

其中结果包含转换结果。