惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
LangChain Blog
G
Google Developers Blog
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
DataBreaches.Net
C
Check Point Blog
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
博客园_首页
S
SegmentFault 最新的问题
The Cloudflare Blog
NISL@THU
NISL@THU
T
The Exploit Database - CXSecurity.com
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
H
Help Net Security
大猫的无限游戏
大猫的无限游戏
Spread Privacy
Spread Privacy
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
U
Unit 42
S
Schneier on Security
博客园 - 司徒正美
Help Net Security
Help Net Security
O
OpenAI News
PCI Perspectives
PCI Perspectives
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
Forbes - Security
Forbes - Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
News | PayPal Newsroom
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Threatpost
V
Vulnerabilities – Threatpost
美团技术团队
P
Palo Alto Networks Blog
TaoSecurity Blog
TaoSecurity Blog
V2EX - 技术
V2EX - 技术
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ

博客园 - nect

【转】ie9 rc版软件兼容问题 [z]前端设计IE6/IE7/IE8/IE9/FF问题汇总:IE和FirFox兼容问题 - nect - 博客园 [z]ie和FF 在insertRow和insertCell的区别 [z]JS在IE和FF下attachEvent,addEventListener学习笔记 - nect - 博客园 WinForm使用webclient通过http的POST方式上传文件 转:另类解决:“ScriptManager”不是已知元素。原因可能是网站中存在编译错误。 - nect - 博客园 转:css妙用1-用图片替换文字 .net中的正则表达式(一)——转义字符 使用Cascadingdropdown控件遇到的一个问题 IP地址匹配算法 服务器控件的客户端验证脚本 gridview 中模板列无法响应row_command事件 - nect - 博客园 在asp.net Atlas中调用 Web Service时无法找到自定义的Web Service对象的可能原因 【转】Prototype.js开发笔记//mark一下 在GridView中使用邮件链接 【转】ASP.net2。0中解决无法获取 GridView 隐藏列值问题 GridView 中格式化整理 [转]操纵自如--页面内的配合与通信 [导入]Java调用.net的WebService
从一个字符串中Remove另一个字符串
nect · 2007-11-21 · via 博客园 - nect

vb中的string操作方法提供了mid(从string1中截取需要的一段string)的功能,但是实际程序中需要从string1中返回去除string2的字符串,vb代码如下,大家可以模拟改成其他语言。

Public Function RemoveString(SourceString As String, CutString As String, Optional iStart As Long = 1, Optional iSkipCount As Integer = 0As String
    
'删除 SourceString 中的 RemoveString ,从 iStart 开始查找 RemoveString,跳过 iSkipCount 个不删除
    Dim startPos As Long, endPos As Long, iSkip As Integer
    
Dim str1 As String, str2 As String
    
    iSkip 
= iSkipCount
    startPos 
= VBA.InStr(iStart, SourceString, CutString, vbTextCompare)
    
Do While startPos > 0 And iSkip > 0
        startPos 
= VBA.InStr(startPos + 1, SourceString, CutString, vbTextCompare)
        iSkip 
= iSkip - 1
    
Loop
    
If startPos > 0 And iSkip = 0 Then
        str1 
= VBA.Left(SourceString, startPos - 1)
        str2 
= VBA.Right(SourceString, VBA.Len(SourceString) - VBA.Len(str1 + CutString))
        RemoveString 
= str1 + str2
    
Else
        RemoveString 
= SourceString
    
End If

End Function