함수 remove()

  다른 뜻에 대해서는 rm 문서를 참조하십시오.
  다른 뜻에 대해서는 jQuery .remove() 문서를 참조하십시오.
remove()

1 Java[ | ]

HashMap<String,Object> member = new HashMap<String,Object>();
member.put("ID", "102");
member.put("Name", "YONEZAWA Akinori");
member.put("Address", "Naha, Okinawa");

System.out.println( member );
// {Address=Naha, Okinawa, ID=102, Name=YONEZAWA Akinori}
member.remove("Name");
System.out.println( member );
// {Address=Naha, Okinawa, ID=102}

2 JavaScript[ | ]

let fruits = ['apple', 'banana', 'cranberry'];
fruits.splice(fruits.indexOf('banana'),1);
console.log(fruits);

3 PHP[ | ]

$fruits = ['apple', 'banana', 'cranberry'];
$fruits = array_filter($fruits, fn($x) => $x != 'banana');
print_r($fruits);
$fruits = ['apple', 'banana', 'cranberry'];
$fruits = array_diff($fruits, ['banana']);
print_r($fruits);
$fruits = ['apple', 'banana', 'cranberry'];
foreach(array_keys($fruits, 'banana') as $k) unset($fruits[$k]);
print_r($fruits);
$fruits = ['apple', 'banana', 'cranberry'];
if(($k = array_search('banana', $fruits)) !== false) unset($fruits[$k]);
print_r($fruits);

4 Python[ | ]

fruits = ['apple', 'banana', 'cranberry']
fruits.remove('banana')
print( fruits ) # ['apple', 'cranberry']

5 Perl[ | ]

my @fruits = ( 'apple', 'banana', 'cranberry' );
@fruits = grep {!/^banana$/} @fruits;
print @fruits;
# applecranberry

6 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}