当前位置:网站首页>What is the function of the regular expression replaceFirst() method?
What is the function of the regular expression replaceFirst() method?
2022-08-05 09:32:00 【qq_25073223】
From:
The regular expression replaceFirst() methodWhat function does it have?
The following author describes the function introduction of the replaceFirst() method, as follows:
The function of the replaceFirst() method: Use regular replacement to match the first matched string. The syntax of the replaceFirst() method: Pattern pattern = Pattern.compile("regular"); //Generate regular expression Matcher matcher = pattern.matcher("regular 122 regular 88988"); //match character matcher.replaceFirst("Java")); //replace characterExample:
package com.java265.other;import java.util.regex.Matcher;import java.util.regex.Pattern;public class testClass {/** Use of java265.com Pattern class*/public static void main(String[] args) {Pattern pattern = Pattern.compile("regular"); //Generate regular expressionMatcher matcher = pattern.matcher("regular 122 regular 88988"); //match charactersSystem.out.println(matcher.replaceFirst("Java")); // replace character}}------Run the above code, the following information will be output-----Java122 regular 88988边栏推荐
猜你喜欢

2.4G无线收发模块的应用

5.部署web项目到云服务器

手把手教你纯c实现异常捕获try-catch组件

茄子科技CEO仇俊:以用户为中心,做用户真正需要的产品

Creo 9.0 基准特征:基准坐标系

What is CRM Decision Analysis Management?

ECCV 2022 Oral 视频实例分割新SOTA:SeqFormer&IDOL及CVPR 2022 视频实例分割竞赛冠军方案...

蚁剑webshell动态加密连接分析与实践

Seata source code analysis: initialization process of TM RM client

pytorch余弦退火学习率CosineAnnealingLR的使用
随机推荐
2022-08-01 Review the basic binary tree and operations
Marketing Suggestions | You have an August marketing calendar to check! Suggest a collection!
Going to book tickets tomorrow, ready to go home~~
Does flink cdc support synchronization from oracle dg library?
蚁剑webshell动态加密连接分析与实践
无题十二
程序员的七种武器
tensorflow.keras cannot introduce layers
CCVR eases heterogeneous federated learning based on classifier calibration
CCVR基于分类器校准缓解异构联邦学习
轩辕实验室丨欧盟EVITA项目预研 第一章(四)
Concurrent CAS
无题五
How ali cloud storage database automatically to speed up the loading speed of www.cxsdkt.cn how to set up the case?
茄子科技CEO仇俊:以用户为中心,做用户真正需要的产品
Voice conversion相关语音数据集综合汇总
Xcode10的打包方式distribute app和启动项目报错以及Xcode 打包本地ipa包安装到手机上
无题七
深度学习21天——卷积神经网络(CNN):天气识别(第5天)
5.部署web项目到云服务器