📄 pb_remove.m
字号:
function pb_remove(pb_htable,name)
% 从电话本中删除记录
% 检查用户是否存在
if ~pb_htable.containsKey(pb_keyfilter(name))
disp(sprintf('The name %s is not in the phone book',name))
return
end;
% 如果用户存在,确定后删除电话
r = input(sprintf('Remove entry %s (y/n)? ',name), 's');
if r == 'y'
pb_htable.remove(pb_keyfilter(name));
disp(sprintf('%s has been removed from the phone book',name))
else
disp(sprintf('%s has not been removed',name))
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -