当前位置:网站首页>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

边栏推荐
- FoxPro and I
- Kindle down, ireader relay
- K - or unblocked project (minimum spanning tree)
- Specific steps for installing mysql8.0 on Windows system
- 1027 colors in Mars (20 points)
- Policy Center > Device and Network Abuse
- [matlab] 2D drawing summary
- Flask Sqlalchemy - how to use custom query criteria ---orm (7)
- Preliminary study on AI noise reduction evaluation system of sound network
- (Niuke) BFS
猜你喜欢

阿里云oss对象存储跨域设置

4.4 string

Rte2021 review of the practice and the way of AI OPS landing

Policy Center-Permissions and APIs that Access Sensitive Information

Advanced C language - pointer 3 - knowledge points sorting

数据治理市场:亿信华辰朝左,华傲数据向右
![[matlab] 3D drawing summary](/img/57/05156340ccdd79b866c4df955b3713.jpg)
[matlab] 3D drawing summary

开源 STM32 USB-CAN项目

Summary of system stability construction practice

Review 2021, embrace change and live up to Shaohua
随机推荐
Policy Center > Deceptive Behavior
【子矩阵数量统计】CF1181C Flag子矩阵数量统计
4.6 floating point number
Alibaba cloud OSS object storage cross domain settings
Chapter III installation and use of jupyter
Jupyter notebook basic knowledge learning
RTC monthly tabloid programming challenge ended successfully in June; Review of the first anniversary of sound network's listing
Tetris source code (color version)
Openresty built in variable
J - Borg maze (minimum spanning tree +bfs)
Three types of technical debt that programmers often encounter: code, data, and architecture
[ten thousand words long article] thoroughly understand load balancing
4.5 integer
深入理解.Net中的线程同步之构造模式(二)内核模式1.内核模式构造物Event事件
Explain service idempotency design in detail
I - constructing roads
1149 dangerous goods packaging (25 points)
Technology sharing | how to quickly realize audio and video online calls
Guada digital analog
Kindle down, ireader relay