找回密码
 立即注册

QQ登录

只需一步,快速开始

lgxl6925

初级会员

43

主题

130

帖子

397

积分

初级会员

积分
397

微信认证勋章

[已处理] 求助:替换字符

lgxl6925
初级会员   /  发表于:2022-3-16 17:13  /   查看:1923  /  回复:4
1金币
查找整个表格,把指定字符(例如:2022年3月16日)替换为“日期”,如何实现?谢谢!

最佳答案

查看完整内容

目前只提供了查找功能,没有提供替换以及整体替换功能 https://www.grapecity.com/spreadnet/docs/latest/online-asp/FarPoint.Web.Spread~FarPoint.Web.Spread.FpSpread~Search(Int32,String,Boolean,Boolean,Boolean,Boolean,Int32,Int32,Int32,Int32).html

4 个回复

倒序浏览
最佳答案
最佳答案
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2022-3-16 17:13:15
来自 2#
目前只提供了查找功能,没有提供替换以及整体替换功能

https://www.grapecity.com/spread ... ead.FpSpread~Search(Int32,String,Boolean,Boolean,Boolean,Boolean,Int32,Int32,Int32,Int32).html
回复 使用道具 举报
lgxl6925
初级会员   /  发表于:2022-3-17 09:04:13
3#
本帖最后由 lgxl6925 于 2022-3-17 10:02 编辑

查找到字符串的行列,再设置Text也行,只是search不会用啊,能给个C#示例吗?
如:
查找表格中含“abcd”字符串的行列坐标

Search的参数搞不明白
回复 使用道具 举报
lgxl6925
初级会员   /  发表于:2022-3-17 11:38:29
4#
好了,谢谢。
  protected void th(string str,string str1)
        {
        
int sheetIndex=0; //工作表索引
string searchString = str; //查找的字符串
Boolean caseSensitive=true; //是否完全匹配
Boolean exactMatch=true;
Boolean alternateSearch = true;
Boolean useWildcards = true;
Boolean includeCellText = true;
Boolean includeNotes = true;
Boolean includeTags = true;
int startRowIndex=0;
int startColumnIndex=0;
int foundRowIndex=100;
int foundColumnIndex=100;
string value;

value = FpSpread1.Search(sheetIndex, searchString, caseSensitive, exactMatch, alternateSearch, useWildcards, includeCellText, includeNotes, includeTags, startRowIndex, startColumnIndex,ref foundRowIndex,ref foundColumnIndex);
int aaa = foundRowIndex;
int bbb = foundColumnIndex;
FpSpread1.Sheets[0].Cells[aaa, bbb].Text = str1;
        }
}

评分

参与人数 1金币 +300 收起 理由
Richard.Ma + 300 感谢分享代码

查看全部评分

回复 使用道具 举报
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2022-3-17 11:52:43
5#
本帖最后由 Richard.Ma 于 2022-3-17 11:54 编辑

不客气,也感谢你在论坛分享自己的代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部