Exercise
demo <- "Hello world or hello hell"
Try to predict what the outcome would be from the following code:
sub("l", "_", demo)
sub("l{3}", "_", demo)
sub("l{2}", "_", demo)
sub("l+", "_", demo)
sub("l*", "_", demo)
demo <- "Hello world or hello hell"
Try to predict what the outcome would be from the following code:
sub("l", "_", demo)
sub("l{3}", "_", demo)
sub("l{2}", "_", demo)
sub("l+", "_", demo)
sub("l*", "_", demo)