当前位置:网站首页>Phone number shielding function
Phone number shielding function
2022-06-30 15:40:00 【Frog claw white】
demand
Enter a mobile phone number with the keyboard , Block the middle four digits , The final effect is :
analysis
① Enter a string on the keyboard .
② Call the interception of string object API, Intercept the first three bits of the string 、 The last four .
③ Top three Connect “****” Then continue to connect the last four digits , Just output the final result .
Code
package com.xxf1.string;
import java.util.Scanner;
/* * Mobile phone number shielding * */
public class StringDemo3 {
public static void main(String[] args) {
//1、 Enter the phone number on the keyboard
Scanner sc = new Scanner(System.in);
System.out.println(" Please enter your mobile number :");
String tel = sc.next();
//2、 Intercept the first three and last four digits of the number
String before = tel.substring(0, 3);
String after = tel.substring(7);
String s = before + "****" + after;
System.out.println(s);
}
}
test

边栏推荐
- Abstract meaning
- Chapter III installation and use of jupyter
- Operator%
- 交调与互调的区别
- B. Moamen and k-subarrays (codeforce+ binary search)
- 1018 public bike Management (30 points)
- K - rochambau (joint search, enumeration)
- Kindle倒下,iReader接力
- Three types of technical debt that programmers often encounter: code, data, and architecture
- Developer practice - the future of Agora home AI audio and video
猜你喜欢

Policy Center > Malware > Malware

Technology sharing | how to quickly realize audio and video online calls

Scattered knowledge of C language (unfinished)

Visualization of provincial GDP with CSV metabase processing

《你的灯亮着吗》开始解决问题前,得先知道“真问题”是什么
![[ten thousand words long article] thoroughly understand load balancing](/img/58/5fcc75bf42582cf08a31923f35aebb.jpg)
[ten thousand words long article] thoroughly understand load balancing

C language foundation - pointer array - initialization method & constant pointer array, pointer constant array
![001 data type [basic]](/img/36/90fdf51a20f8c708b9c38610b377d6.jpg)
001 data type [basic]

【子矩阵数量统计】CF1181C Flag子矩阵数量统计

Model system: Sword (1)
随机推荐
1027 colors in Mars (20 points)
How does sd-rtn ensure the high availability of RTE services after infrastructure failure
终于看懂科学了!200张图领略人类智慧的巅峰
Xiao Sha's pain (thinking problem)
Openresty built in variable
1025 pat ranking (25 points)
Experiment of the planning group of the West University of technology -- pipeline CPU and data processing Adventure
Fundamentals of C language -- similarities and differences between arrays and pointers
Some reference routines for cache update
At the beginning of the 2022 new year, I will send you hundreds of dry articles
阿里云oss对象存储跨域设置
Single cycle CPU of the design group of West University of Technology
Data governance Market: Yixin Huachen faces left, Huaao data faces right
Technology sharing | anyrtc service single port design
【子矩阵数量统计】CF1181C Flag子矩阵数量统计
Policy Center > Malware > Malware
How to browse mobile web pages on your computer
1031 Hello world for u (20 points)
1062 talent and virtue (25 points)
Webrtc: industrial application based on Internet of things