开发者

Replace value in string c# not working

            <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
    开发者_C百科            </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>

So this is actually a string I have in c#, and I want to replace tbody with table, so I'm trying to do it like this:

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

But it isn't working. Why?


You should do:

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


Because string.Replace does not modify the string, it returns a new one

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

will do the trick.


Strings are immutable. That means you don't modify them - .Replace returns a NEW string. Try this:

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


You should save the result of Replace: _viewPath = _viewPath.Replace("tbody", "table");


Replace is a function actually, and does return the results. You have to do it this way :

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

where Results contains the result of the transformation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜