regular expression get string between komma and dot code example

Example 1: Create a function generateString(char, val) that returns a string with val number of char characters concatenated together. For example generateString('a', 7) will return aaaaaaa.

Create a function generateString(char, val) that returns a string with val number of char characters concatenated together. For example generateString('a', 7) will return aaaaaaa.
def generateString(char, val):
  output = ""
  for i in range(0, val):
    output = output + char
  return(output)
print(generateString(character, count))

Example 2: there is no difference in R between a string scalar and a vector of strings

x <- "\u00b5"
x
#> [1] "µ"

Tags:

Misc Example