are_two_strings_same <- function(s1, s2, len_verbose=121, trim_pre_linebreak=FALSE, verbose="auto") {
  is.char_of_length1(s1, fail=TRUE)
  is.char_of_length1(s2, fail=TRUE)

  ## check the character count
  nc.s1 <- nchar(s1)
  nc.s2 <- nchar(s2)

  if (trim_pre_linebreak) {
    s1 <- gsub(" +(\\\\n|\n)", "\\1", s1)
    s2 <- gsub(" +(\\\\n|\n)", "\\1", s2)
  }

  nc_removed.s1 <- nc.s1 - nchar(s1)
  nc_removed.s2 <- nc.s2 - nchar(s2)

  if (isTRUE(s1 == s2) || is.na(s1) && is.na(s2)) {
    verboseMsg(isTRUE(verbose), "s1 and s2 are identical", 
        if (nc_removed.s1 || nc_removed.s2)
          " except for possibly some straglling whitespace at the end of a line, pre linebreaks"
      )
    return(TRUE)
  }

  ## set verbose to TRUE if they are not the same
  if (identical(verbose, "auto"))
    verbose <- TRUE

  if (is.na(s1)) {
    verboseMsg(verbose, "s1 is NA;  s2 is:\n", substr(s2, 1, max(len_verbose, 1000)), func="message")
    return(FALSE)
  }
  if (is.na(s2)) {
    verboseMsg(verbose, "s2 is NA;  s1 is:\n", substr(s1, 1, max(len_verbose, 1000)), func="message")
    return(FALSE)
  }


  L1 <- strsplit(s1, "")[[1]]
  L2 <- strsplit(s2, "")[[1]]

  ## Check if they are the same, less white-space
  white_space_chars <- c("\\n", " ", "\n", "\t")
  L1.no_ws <- L1[L1 %ni% white_space_chars]
  L2.no_ws <- L2[L2 %ni% white_space_chars]
  if (length(L1.no_ws) == length(L2.no_ws) && all(L1.no_ws == L2.no_ws)) {
    verboseMsg(verbose, "S1 and S2 are the same, except for white space")
  }

  min_length <- min(length(L1), length(L2))
  first_diff <- max(min(which(suppressWarnings(L1 != L2)), min_length), 0)

  frm <- floor(max(1, first_diff - (len_verbose / 2)))
  to  <- ceiling(first_diff + (len_verbose / 2))

  example1 <- substr(s1, start=frm, stop=to)
  example2 <- substr(s2, start=frm, stop=to)

  verboseMsg(verbose, "First diff: \n", "\n\t---- s1 ----\n", example1, "\n\t---- s2 ----\n", example2)
  return(FALSE)

}
