我想知道我怎么看所有以A开头的名字[重复]

时间:2021-12-01 18:01:51

This question already has an answer here:

这个问题在这里已有答案:

I want to know how i look all the names that begin with A or B or something like that example i have David Daniel Jose Alejandro and i only want that names that begin with the A. can someone tell me. name = start with A Is it now clear what I need?

我想知道我是如何看待以A或B开头的所有名字或类似的例子我有大卫丹尼尔何塞亚历杭德罗,我只想要那些以A.开头的名字。有人可以告诉我。 name =以A开头我现在清楚我需要什么吗?

1 个解决方案

#1


I think you are looking for this:

我想你正在寻找这个:

How to get first character of string?

如何获得字符串的第一个字符?

Basically

if (yourstring.charAt(0) == 'A'){
  *your desired code*
}

#1


I think you are looking for this:

我想你正在寻找这个:

How to get first character of string?

如何获得字符串的第一个字符?

Basically

if (yourstring.charAt(0) == 'A'){
  *your desired code*
}