我想把“你”换成“你的妹妹”。然而,像"youtube“这样的词必须保持不变。所以我决定用
replace(/ you /, " your sister ");
然而,现在的弦“我爱你!”保持不变,以及任何没有空格的字串后面的字串。我想知道“你”这个词后面的字符是不是字母。如果是,保持不变,如果不是,把它改为“你的妹妹”。
让我们说模式是“爱”字串
输入
This is some text
Love this or that
He is running like a rabbit
输出
This is some text
Love this or thatHe is running like a rabbit
我注意到sed对于删除换行符是非常不愉快的,知道吗?
我想用某些字符代替ssn。例如:
public char filter = "a";
public String ssn = 123-45-6789
public replace(string ssn){
//replace ssn = aaa-aa-aaaa because filter = "a"
}
有人能告诉我怎么做吗,因为它里面有"-“字串?
如何从选定的字串中找到左字串和右字串,例如,我有一个字串:
string input = "all our vidphone lines here are trapped. they recirculate the call to other offices within the building";
var word = new List<string> { "other", "they", "all" };
if (word.Any(input.Contains))
{
//and here I
~$ bash --version
GNU bash, version 5.1.12(1)-release (x86_64-pc-linux-gnu)
~$ alias bab=python
~$ $(echo bab)
bash: bab: command not found
我希望bab会变成"python",但看起来并非如此。
~$ $(echo alias)
alias bab='python'
alias ls='ls --color=auto'
~$ bab
Python 3.10.1 (main, Dec 11 2021, 17:2
我正在使用Ubuntu18.04并尝试使用apt卸载旧的内核映像。但是,我收到一个错误,它不能被卸载,因为标题丢失了。我如何卸载它们?下面是命令sudo apt autoremove的部分输出
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-extra-3.13.0-39-generic linux-image-extra-3.13.0-40-gen
我有这样一个R字串
a <- "(hi I am (learning R) )"
我想在上面的字符串中添加一个字符"x“,使它像
"(hi I am (learning R)x )"
如何有效地利用R来实现这一点?
编辑:再添加一个信息:假设开始字符串的模式可以改变,但是最后的两个括号将始终保持不变,我必须一直在它们之间插入x。
每当我启动apache server(安装在EC2上)时,它都会显示带有"Amazon Linux AMI test Page“标题的测试页面。我想用类似于"Linux AMI - Started“这样的东西来更改措辞。(注意:我不想用我的文本替换整个页面,我想要相同的页面,但标题是"Linux AMI - Started“,而不是"Amazon Linux AMI Test Page”。我在下面试过了,但不幸的是它不起作用。
sed /Amazon Linux AMI测试页/Linux AMI - Started/g‘/var/wwww/html/index.
我下载了jmf-2_1_1e-linux-i589.bin并尝试运行,但它表明
Do you agree to the above license terms? [yes or no]
y
Permit recording from an applet? (see readme.html) [yes or no]
y
Permit writing local files from an applet? (recommend no, see readme.html) [yes or no]
y
Unpacking...
Extracting...
/home/hm/Downloads/