c# - How to find and get string after a string known values in a text file c#
问题描述
I want to find and get a string after a string known values in a text file with c#
My text file:
function PreloadFiles takes nothing returns nothing
call Preload( "=== Save ===" )
call Preload( "Player: Michael" )
call Preload( "-load1 UvjkiJyjLlPN1o7FCAwQ0en80t769u5uBKAL1t0u0Cajk86WNmp83F" )
call Preload( "-load2 IMdOIPKGSDFXStx4Zd4LAvAaBmHW19rxsvSNF6kaObSFyBzGq8skYGuq0T1eW" )
call Preload( "-load3 Bd6MoyqnfDydBbwqGApWii3mabJpwNvjcwrKLI0r6UU2wadrMV1h7WQ8D6" )
call Preload( "-load4 D5kI18Flk5bJ4Oi7vQw33b5LHDXHGgJNYsiC6VNJDAHe1" )
call Preload( "KEY PASS: 3568" )
endfunction
i want to get string after string "-load1" ,"-load2" ,"-load3" ,"-load4" ,"KEY PASS: " and fill them on 5 Textbox
like that
UvjkiJyjLlPN1o7FCAwQ0en80t769u5uBKAL1t0u0Cajk86WNmp83F
IMdOIPKGSDFXStx4Zd4LAvAaBmHW19rxsvSNF6kaObSFyBzGq8skYGuq0T1eW
Bd6MoyqnfDydBbwqGApWii3mabJpwNvjcwrKLI0r6UU2wadrMV1h7WQ8D6
D5kI18Flk5bJ4Oi7vQw33b5LHDXHGgJNYsiC6VNJDAHe1
3568
Please help me
Thanks you!
解决方案
您可以使用
string Substring (int startIndex);
喜欢:
string in1 = "-load1 UvjkiJyjLlPN1o7FCAwQ0en80t769u5uBKAL1t0u0Cajk86WNmp83F";
string out = in1.substring(7);
它返回:
"UvjkiJyjLlPN1o7FCAwQ0en80t769u5uBKAL1t0u0Cajk86WNmp83F"
推荐阅读
- java - 将 SQL 或 UTIL DATE 转换为预期格式“dd-MMM-yyyy”,但不是字符串值
- c# - 如何检查您的表单是否已经打开并关闭它
- inheritance - 覆盖并更改函数的中间部分 Odoo
- python-3.x - arcpy python3中Origin Destination Matrix Analyst的输出问题
- javascript - 决定 State Monad 中的状态和内容
- excel - 嵌套If条件VBA
- reactjs - 来自数据的 CircleMarker 多类名
- java - 只有 1 个 onClickListener 适用于谷歌地图活动中的标记
- java - 从java中的子文档获取父文档值
- android - 如何使用 MotionLayout 调整 TextView 的大小