Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
How to concatenate strings in FunC?

What is the right way to concatenate strings? I've tried this but didn't succeed:

.store_slice("start test " + VAR1 + " finish text")


This question was imported from Telegram Chat: https://t.me/tondev/114163

  
  
Posted 2 years ago
  
  

there's no strings in func

Kirill Kirilenko   2 years ago Report
Votes Newest

Answers


The string type in FunC is represented by slice, so you need to create new cell and put substrings in it:

	slice charA = "A"; ;; char A
	slice charB = "B"; ;; char b

	;; create cell with "ABBA" string in it
	cell cellABBA =
		begin_cell()
			.store_slice(charA)
			.store_slice(charB)
			.store_slice(charB)
			.store_slice(charA)
		.end_cell();

	;; convert cell to slice (or simply use the cell itself)
	slice stringABBA = cellABBA.begin_parse();

	~strdump(stringABBA);	;; #DEBUG#: ABBA
2
2
Posted 2 years ago
17K Views
1 Answer
2 years ago
2 years ago
Tags