ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 组件源码 ``` /** * @category 字符串包含 * @param instr * 入参|原字符串|{@link java.lang.String} * @param substr * 入参|子字符串|{@link java.lang.String} * @return 0 失败<br/> * 1 成功<br/> */ @InParams(param = { @Param(name = "instr", comment = "原字符串", type = java.lang.String.class), @Param(name = "substr", comment = "子字符串", type = java.lang.String.class) }) @Returns(returns = { @Return(id = "0", desp = "失败"), @Return(id = "1", desp = "成功") }) @Component(label = "字符串是否包含", style = "判断型", type = "同步组件", comment = "字符串包含", version = "1.0.0", deprecated = false, author = "test", date = "2018-01-22 04:10:16") public static ResultBase P_contains(String instr, String substr) { if (instr == null) { return ResultBase.newFailureResult("TPTS1002", "原字符串不能为空"); } if (instr.contains(substr)) { return ResultBase.newSuccessResult(); } return ResultBase.newFailureResult("TPTS1003", "字符串不包含子字符串:" + substr); } ``` # 交易中组件使用方式 ![](https://img.kancloud.cn/c1/cd/c1cd930974aa13db6d34c3897f25b6a9_1868x895.png) # 参数说明及示例 ## 入口参数 原字符串:输入一串字符串,示例: `"asdqwezcsadasd"` 子字符串:输入一串字符串,示例: `"qwe"`