Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 644 Bytes

concatenate-string-in-lua.md

File metadata and controls

33 lines (27 loc) · 644 Bytes

Concatenate string in Lua

server {
  location / {
    content_by_lua_block {
      local str1 = "Hi "
      local str2 = "All!"
      ngx.say(str1 .. str2)
    }
  }
}
  • content_by_lua_block - lib:nginx-lua module directive to specify block of Lua code
  • local str1 - defines first string
  • local str2 - defines second string
  • str1 .. str2 - concatenates str1 and str2

group: string

Example:

local str1 = "Hi "
local str2 = "All!"
ngx.say(str1 .. str2)
Hi All!

link_youtube: https://youtu.be/GBoWG6OA_oQ