也许这个问题有点困惑.我将以更好的方式解释这个代码
string myfirststring = "hello1,hello123,content";
string_2 = "ent";
if (myfirststring.Contains(string_2)){
Console.WriteLine("Yes! this is included in the 1 string");
//then check if string_2 is equal to the 3 element of 1 string: content
}
Run Code Online (Sandbox Code Playgroud)
现在我想检查我的包含字符串"string_2"是否完全等于myfirststring的3个元素:content(在这种情况下不是因为值是ent而不是内容所以ent!= content)所以我该如何检查?
我在 html 页面(JavaScript)中有此代码:
<script>
var cox,d = 0;
Console.Log(cox,d);
</script>
Run Code Online (Sandbox Code Playgroud)
现在我[var cox,d = 0; Console.Log(cox,d);]用 base64 编码手动加密,结果是这样的:IHZhciBjb3gsZCA9IDA7DQogQ29uc29sZS5Mb2coY294LGQpOw==
我希望这个编码的字符串(代码)可以由同一页面中的另一个 JavaScript 函数执行......例如:
<script>
var encoded = "IHZhciBjb3gsZCA9IDA7DQogQ29uc29sZS5Mb2coY294LGQpOw==";
var decodedString = atob(encoded);
/* Problem is here */
</script>
Run Code Online (Sandbox Code Playgroud)
我想在/* Problem is here */'.
我能怎么做?