MCPcopy Create free account
hub / github.com/7BEII/Comfyui_PDuse / join_strings

Method join_strings

py/text_JoinStringMultiLine.py:31–43  ·  view source on GitHub ↗
(self, string_1, string_2)

Source from the content-addressed store, hash-verified

29 CATEGORY = "PD Nodes"
30
31 def join_strings(self, string_1, string_2):
32 # 核心逻辑:中间加一个换行符 \n
33 s1 = str(string_1) if string_1 is not None else ""
34 s2 = str(string_2) if string_2 is not None else ""
35
36 # 如果第一项为空,直接返回第二项,避免头部出现空行
37 if s1 == "":
38 return (s2,)
39 if s2 == "":
40 return (s1,)
41
42 result = s1 + "\n" + s2
43 return (result,)
44
45
46class PD_StringLineCount:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected