Deprecated: Array and string offset access syntax with curly braces is deprecated in /opt/lampp/htdocs/aura/couch/field.php on line 1447 code example
Example 1: Error in charToDate(x) : character string is not in a standard unambiguous format
library(lubridate)
data$created_date1 <- mdy_hm(data$created_at)
data$created_date1 <- as.Date(data$created_date1)
Example 2: python how to format a string with quotation marks to and array with split(" ")
def format_string_to_array(string):
array = []
array_item = ""
is_quote = False
i = 0
while i < len(string):
if string[i:i+1] == " ":
if is_quote == True:
array_item += string[i]
elif is_quote == False:
if not array_item == "":
array.append(array_item)
array_item = ""
elif string[i:i+1] == "\"" or string[i:i+1] == "\'":
if is_quote == False:
is_quote = True
else:
array.append(array_item)
array_item = ""
is_quote = False
else:
array_item += string[i]
i += 1
array.append(array_item)
return array
a = "Hello \'single array item with spaces\' World!"
print(format_string_to_array(a))