楼主: 神月德
4085 12

[数据管理求助] 如何删除一个变量中的重复字符 [推广有奖]

11
andruw 在职认证  发表于 2015-9-20 22:19:08
夏目贵志 发表于 2015-9-20 22:07
这个。。。我还从没见过。。。我最近老是遇到论坛说我是机器人,要我输验证码。。。
对,机器人这个我也遇到过好几次。。。

12
andruw 在职认证  发表于 2015-9-22 16:02:52
  1. clear
  2. input str20 a
  3. "4,4,5,6"
  4. "5,5,5,5"
  5. "1,3,1"
  6. "1,1"
  7. end

  8. gen b = substr(cond(strpos(a,"0"), "0,", "") + ///
  9.                 cond(strpos(a,"1"), "1,", "") + ///
  10.                 cond(strpos(a,"2"), "2,", "") + ///
  11.                 cond(strpos(a,"3"), "3,", "") + ///
  12.                 cond(strpos(a,"4"), "4,", "") + ///
  13.                 cond(strpos(a,"5"), "5,", "") + ///
  14.                 cond(strpos(a,"6"), "6,", "") + ///
  15.                 cond(strpos(a,"7"), "7,", "") + ///
  16.                 cond(strpos(a,"8"), "8,", "") + ///
  17.                 cond(strpos(a,"9"), "9,", "") , ///
  18.                 1, ///
  19.                 length(cond(strpos(a,"0"), "0,", "") + ///
  20.                 cond(strpos(a,"1"), "1,", "") + ///
  21.                 cond(strpos(a,"2"), "2,", "") + ///
  22.                 cond(strpos(a,"3"), "3,", "") + ///
  23.                 cond(strpos(a,"4"), "4,", "") + ///
  24.                 cond(strpos(a,"5"), "5,", "") + ///
  25.                 cond(strpos(a,"6"), "6,", "") + ///
  26.                 cond(strpos(a,"7"), "7,", "") + ///
  27.                 cond(strpos(a,"8"), "8,", "") + ///
  28.                 cond(strpos(a,"9"), "9,", "")) - 1)
复制代码

13
cristineharbe 发表于 2015-9-23 17:30:49
看不懂
已有 1 人评分经验 收起 理由
夏目贵志 -9 内容不符

总评分: 经验 -9   查看全部评分

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-2 03:01