【发布时间】:2012-06-12 08:02:57
【问题描述】:
您好,感谢您的关注。
编辑:我不是程序员,我几乎不知道 C# 或任何其他语言,所以,抱歉这个问题,我一直在寻找解决方案,但没有任何效果。无论如何,谢谢你否决了我的问题。
言归正传,我得到了这个代码:
using System;
using VisualWebRipper.Internal.SimpleHtmlParser;
using VisualWebRipper;
public class Script
{
public static string TransformContent(WrContentTransformationArguments args)
{
try
{
//Place your transformation code here.
//This example just returns the input data
return args.Content;
}
catch(Exception exp)
{
//Place error handling here
args.WriteDebug("Custom script error: " + exp.Message);
return "Custom script error";
}
}
}
我需要用 C# 做一个条件,让我在 *args.Content(包含变量字符串)中找到字符串 "No se exige",并且如果 Find 匹配,它将字符串值更改为数字 (0) 并返回它。如果不是什么都没有改变。
所以,我只需要搜索一个字符串并将其替换为一个数字,如果它与字符串“No se exige”匹配。
非常感谢您努力阅读我的英语,希望您能帮助我:)
【问题讨论】:
-
到目前为止您尝试过什么?不要指望这个网站不费吹灰之力就为你做功课......
-
几个例子会使描述清晰千倍
-
whathaveyoutried.com - 为了我们和我们的兄弟们,请阅读它。
-
我很抱歉,但我不是程序员,所以我问:(
-
如果你不是程序员,那你为什么要写代码?
标签: c# search replace conditional-statements