string.indexof(“)”)无效

时间:2015-11-19 05:13:57

标签: java string

当我运行以下代码时,其输出为

Error: Cannot find module 'lodash'

我需要以下输出:

lcp-   -1  ncp-   -1

代码:

lcp-   8  ncp-   8

当我运行代码时,它打印-1,-1表示lcp和nap。我该如何解决?

2 个答案:

答案 0 :(得分:3)

<html> <head> <style>.col{padding:3px 20px 3px 20px}</style> </head> <body style="font-family:tahoma"> <div style="background:rgb(230,230,230); padding:5px ;border:1px solid black;"> <b style="color:rgb(51,153,255)">Sample header</b> <img style="float:right" height="25px" width= "80px" src="resources/images/itext.png" /> </div> <br /> <table border='0' style='border-collapse: collapse;'> <tr> <td class="col">String 1</td> <td class="col">: 1234354545</td> </tr> <tr> <td class="col">String 2</td> <td class="col">: rere</td> </tr> <tr> <td class="col">String 3</td> <td class="col">: ureuiu</td> </tr> <tr> <td class="col">Date</td> <td class="col">: dfdfjkdjk</td> </tr> </table> <br /> <br /> <br /> <hr/> <br /> Contact us </body> </html> 会使fun=fun.substring(0, fun.length()-2);等于fun。所以,你永远不会在字符串中有M(a,b,c。要从)中删除;,请改用fun

答案 1 :(得分:0)

仍然可以得到答案:lcp- 7 ncp- 7

您需要在b

中打印前添加1
System.out.println("lcp-   "+ (lcp+1) +"  ncp-   "+(ncp+1));