package com.sd.shupathwebview import com.sd.shupathwebview.utils.FileIoUtils import org.junit.Test import org.junit.Assert.* /** * Example local unit test, which will execute on the development machine (host). * * See [testing documentation](http://d.android.com/tools/testing). */ class ExampleUnitTest { @Test fun addition_isCorrect() { assertEquals(4, 2 + 2) } @Test fun testStr() { // var str="这是第一行。\n这是第二行。\r\n这是第三行。\r这是第四行??" var str = "6786786786u76四\n行\r\n??" str= str.run { var index = str.lastIndexOf("??") return@run substring(0..index - 1).replace("[\n\r]+".toRegex(), "").trim() } // var index = str.lastIndexOf("??") // println("index = ${index}") // str = str.substring(0..index - 1).replace("[\n\r]+".toRegex(), "").trim() println("------str =${str}") } }