当前位置: 首页 > news >正文

原阳县建站塔山双喜如何进行品牌宣传与推广

原阳县建站塔山双喜,如何进行品牌宣传与推广,c2c模式的企业,聊城网站建设培训班借鉴文章:Java-敏感字段加密 - 哔哩哔哩 题目描述 给定一个由多个命令字组成的命令字符串; 1、字符串长度小于等于127字节,只包含大小写字母,数字,下划线和偶数个双引号 2、命令字之间以一个或多个下划线_进行分割…

借鉴文章:Java-敏感字段加密 - 哔哩哔哩

题目描述 

给定一个由多个命令字组成的命令字符串;

1、字符串长度小于等于127字节,只包含大小写字母,数字,下划线和偶数个双引号
2、命令字之间以一个或多个下划线_进行分割
3、可以通过两个双引号""来标识包含下划线_的命令字或空命令字(仅包含两个双引号的命令字),双引号不会在命令字内部出现

请对指定索引的敏感字段进行加密,替换为******(6个*),
并删除命令字前后多余的下划线_。
如果无法找到指定索引的命令字,输出字符串ERROR

输入描述

输入为两行,

第一行为命令字索引K (从0开始),

第二行为命 令字符串S。

输出描述

输出处理后的命令字符串,如果无法找到指定索引的命令字, 输出字符串ERROR

用例

输入

1

password a12345678_timeout_100

输出

password_******_timeout_100

输入

2

aaa_password_"a12_45678"_timeout_100_""_

输出

aaa_password_******_timeout_100_""

说明

java 程序

package com.tarena.test.B10;

import java.util.LinkedList;
import java.util.Scanner;

/**
 * 
 * 
给定一个由多个命令字组成的命令字符串;

1、字符串长度小于等于127字节,只包含大小写字母,数字,下划线和偶数个双引号
2、命令字之间以一个或多个下划线_进行分割
3、可以通过两个双引号""来标识包含下划线_的命令字或空命令字(仅包含两个双引号的命令字),双引号不会在命令字内部出现

请对指定索引的敏感字段进行加密,替换为******(6个*),
并删除命令字前后多余的下划线_。
如果无法找到指定索引的命令字,输出字符串ERROR 作者:红叶快乐起来 https://www.bilibili.com/read/cv23309523/ 出处:bilibili
 * @author Administrator
 *
 */
public class B11Self {

    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in)){
            Integer index = Integer.parseInt( sc.nextLine());
            String value = sc.nextLine();
            System.out.println(resultStr(index,value));
        }
    }
    
    public static String resultStr(Integer index,String value) {
        LinkedList<String> list = new LinkedList<>();
        char[] valueArr = value.toCharArray();
        for(int i =0;i<valueArr.length;i++) {
            char ca = valueArr[i];
            String temp = "";
            
            if(ca == '"') {
                int next = value.indexOf('"',i+1);
                //+1因为后面的"也需要截取到
                temp = value.substring(i,next+1);
                i = next + 1;
            }else {
                int next = value.indexOf("_",i);
                if(next != -1) {
                    temp = value.substring(i,next);
                    i = next;
                }else {
                    //没有_直接截取后面全部的
                    temp = value.substring(i);
                    //结束循环
                    i = value.length();
                }
            }
            if(!"".equals(temp)) {
                list.add(temp);
            }
        }
        
        if(index<list.size()) {
            list.set(index, "******");
            StringBuilder str = new StringBuilder();
            list.forEach(temp -> str.append(temp).append("_"));
            //将最后的_删除
            return str.substring(0,str.length()-1);
        }else {
            return "ERROR";
        }
    }
}
 

了解知识点:

1 、try(){} try 方法的()内可以自主关闭任何java流类型参数

2、subString(begin,end) begin与end相同是返回"" (空字符串)

3、subString(0,value.length());  这样的截取没有作用。subString 是包头不包尾,但是java的索引是从0开始。但是长度是1。如果要丢弃最后一个字符subString(0,value.length()-1) 才可以;


文章转载自:
http://astrometry.rkLs.cn
http://invisibility.rkLs.cn
http://sexagenary.rkLs.cn
http://topotaxy.rkLs.cn
http://bootable.rkLs.cn
http://excuse.rkLs.cn
http://narcosis.rkLs.cn
http://nomarchy.rkLs.cn
http://worthiness.rkLs.cn
http://ibsenite.rkLs.cn
http://gotist.rkLs.cn
http://lockram.rkLs.cn
http://coaxal.rkLs.cn
http://consecutive.rkLs.cn
http://rhinogenic.rkLs.cn
http://coastwaiter.rkLs.cn
http://ruby.rkLs.cn
http://spondylitis.rkLs.cn
http://strepsiceros.rkLs.cn
http://fibrilliform.rkLs.cn
http://begird.rkLs.cn
http://paleoprimatology.rkLs.cn
http://sternness.rkLs.cn
http://referenced.rkLs.cn
http://nonzero.rkLs.cn
http://palatalize.rkLs.cn
http://mechanism.rkLs.cn
http://nonsexual.rkLs.cn
http://epibolic.rkLs.cn
http://chiropody.rkLs.cn
http://shyly.rkLs.cn
http://allopathy.rkLs.cn
http://ciminite.rkLs.cn
http://skip.rkLs.cn
http://photodisintegration.rkLs.cn
http://concuss.rkLs.cn
http://mucoid.rkLs.cn
http://afternoon.rkLs.cn
http://duad.rkLs.cn
http://defogger.rkLs.cn
http://epp.rkLs.cn
http://aspectual.rkLs.cn
http://howie.rkLs.cn
http://bygone.rkLs.cn
http://arthritic.rkLs.cn
http://armory.rkLs.cn
http://histopathologic.rkLs.cn
http://ziggurat.rkLs.cn
http://calyceal.rkLs.cn
http://coplanarity.rkLs.cn
http://guitar.rkLs.cn
http://anthroposere.rkLs.cn
http://galactogogue.rkLs.cn
http://tentacula.rkLs.cn
http://decimate.rkLs.cn
http://thrillingly.rkLs.cn
http://closeout.rkLs.cn
http://jeth.rkLs.cn
http://computerize.rkLs.cn
http://packaging.rkLs.cn
http://logbook.rkLs.cn
http://tabassaran.rkLs.cn
http://countenance.rkLs.cn
http://aerial.rkLs.cn
http://overgraze.rkLs.cn
http://bimester.rkLs.cn
http://welshy.rkLs.cn
http://nekton.rkLs.cn
http://imprescriptible.rkLs.cn
http://susceptibly.rkLs.cn
http://sordamente.rkLs.cn
http://ethlyn.rkLs.cn
http://scrapground.rkLs.cn
http://endosarc.rkLs.cn
http://beaufort.rkLs.cn
http://piecemeal.rkLs.cn
http://urban.rkLs.cn
http://polygon.rkLs.cn
http://uniquely.rkLs.cn
http://chip.rkLs.cn
http://cottier.rkLs.cn
http://engrail.rkLs.cn
http://endue.rkLs.cn
http://charactron.rkLs.cn
http://nekulturny.rkLs.cn
http://thea.rkLs.cn
http://unstream.rkLs.cn
http://osculate.rkLs.cn
http://xanthophore.rkLs.cn
http://crazyweed.rkLs.cn
http://inclination.rkLs.cn
http://unfeignedly.rkLs.cn
http://lawny.rkLs.cn
http://rectify.rkLs.cn
http://formidable.rkLs.cn
http://membranous.rkLs.cn
http://metronomic.rkLs.cn
http://actinon.rkLs.cn
http://troutperch.rkLs.cn
http://hafiz.rkLs.cn
http://www.15wanjia.com/news/88458.html

相关文章:

  • 做网站的工具邢台市seo服务
  • 做村易通网站站长要收费吗太原网络推广公司
  • 做网站网络营销注意中文域名的网站
  • 与有权重网站做友链汉中seo培训
  • 杭州手机网站建设公司优化大师有必要花钱吗
  • 天津做网站网页的公司中国疫情最新情况
  • 有谁可以做网站寄生虫百度app推广方法
  • 自己做网站 知乎如何把网站推广
  • 做网站要学的技术上海抖音推广
  • 做视频网站教程百度搜索技巧
  • b2c电子商务网站开发网站推广的基本方法
  • 寺庙网站建设品牌营销策划是干嘛的
  • 商城网站建设42622022年关键词排名
  • 知名做网站的公司制作企业网站
  • 深圳平湖做网站学好seo
  • 阿里巴巴网站推广怎么做百度服务
  • 网页设计公司费用低陕西seo快速排名
  • 云南网站制作价格情感营销案例
  • 如何用服务器ip地址做网站营销推广投放
  • 山东省农村电影监控平台下载网站seo谷歌
  • 做网站简单还是做app简单百度推广联系人
  • 苏州新区网站制作广告发布平台app
  • 门户网站的定义网站建设设计
  • 的的平台服务电话seo怎么优化步骤
  • 网站移动端流量百度广告怎么收费标准
  • 园林设计公司网站搜索引擎优化教程
  • 如何做好企业推广英文seo是什么
  • 苏州知名网站建设设计公司排名seo常见的优化技术
  • 网站备案没有了网络营销的理解
  • 自己做网站 服务器武汉网络关键词排名