If you try the following, is it working for you?
{%- assign parts = product.variants.first.sku | split: '\\' -%}
{%- assign result = parts[0] | append: '\\' | append: parts[1] -%}
(without additional splitting and selecting of the first part)
If you try the following, is it working for you?
{%- assign parts = product.variants.first.sku | split: '\\' -%}
{%- assign result = parts[0] | append: '\\' | append: parts[1] -%}
(without additional splitting and selecting of the first part)