C# string 查找一串字段在字符串中的位置 返回

C# string 查找一串字段在字符串中的位置 返回 
            var split=" <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(0,-277)">
        <ellipse style="opacity:1;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.59999996;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers stroke fill" id="path815-5" cx="9.9379234" cy="286.9158" rx="7.7212577" ry="7.572597" />
        <ellipse style="opacity:1;fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff0000;stroke-width:0.2;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers stroke fill" id="path884" cx="10.005904" cy="287.01077" rx="9.8054514" ry="9.822154" />
    </g>";
            var str="opacity:1;fill:#";
            int cp = split.IndexOf(str);
            var b= split.Substring(cp+16,6);//截取后面几个
            var a =cp.ToString();//返回第一个字符的坐标

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值