If any of these functions are unfamiliar, you can look them up in FileMaker Help.
Try this approach:
paraghString = Trim ( GetValue ( $$mpl_body ; $i ) );
SpaceList = Substitute ( paraghString ; " " ; ¶ ) ;
medSpace = Div ( ValueCount ( SpaceList ) ; 2 ) ;
First = LeftValues ( SpaceList ; medSpace ) ;
Second = RightValues ( SpaceList ; ValueCount ( SpaceList ) - medSpace )
Substitute ( Left ( First ; Length ( First ) - 1 ) & "XXXXX" & Left ( Second ; Length ( Second ) - 1 ) ; [ ¶ ; " " ] ; ["XXXXXX" ; ¶ ] )
) // Let
Note: RightValues and LeftValues append a ¶ to the end of the text they return. I'm using the Left and Length functions to remove these unwanted characters inside the Substitute function.
Thanks Phil, i guess i should've been thinking array...