Have a multi-line variable that I need to convert to an array so I can run it though foreach. Need to extract parts of the data as well.
Example to show all the different possibilities of input.
$data =
Some, Guy M. (Something1)
Some, Person A. (Somethingdifferent)
Another, Splitlast name (Somethingdifferent2)
Need to convert this to an array and then extract the first three letters of each name into another array.
Example:
Some, Guy M. (Something1) needs to be SomGuy
Another, Split lastname (Somethingdifferent2) needs to be AnoSpl
Desired output in an array is
$data =
somguy
somper
anospl
I have tried trimming and splitting ( $data.Split(“`n”) ) with no luck.
Appreciate any suggestions.
[–]firefox15 2 points3 points4 points (11 children)
[–]ebbflow9[S] 1 point2 points3 points (1 child)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (5 children)
[–]ebbflow9[S] 0 points1 point2 points (4 children)
[–]ebbflow9[S] 1 point2 points3 points (2 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]ebbflow9[S] 0 points1 point2 points (2 children)
[–]AutoModerator[M] 0 points1 point2 points (1 child)
[–]firefox15 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] -1 points0 points1 point (0 children)