Assume that "name" variable contains the full name of a person, with the following format: "Lastname, Firstname" or "Lastname, Firstname Midlelnitials". Which of the following expressions will assign a "newname" variable containing the same name, but with the format "Firstname Lastname" or "Firstname Middlelnitials Lastname"? e.g., the name "Sacan, Ahmet" should produce the newname "Ahmet Sacan" and the name "Sacan, Ahmet J." should produce "Ahmet J. Sacan". Assume that the comma character appears only once in the name variable. There may be more than one correct answer. Select all correct answers. O newname = strjoin( fliplr(strsplit(name, ',')), '') O newname = strjoin( fliplr(strip(strsplit(name, ','))), '') OI = find(name==','); newname = [name(I(1)+2:end) '' name(1:1(1)-1)] OI = strfind(name, ', '); newname = [name(I(1)+2:end) '' name(1:1(1)-1)]

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter6: Sub And Function Procedures
Section: Chapter Questions
Problem 2MQ2
icon
Related questions
Question
100%
Assume that "name" variable contains the full name of a person, with the following format: "Lastname, Firstname" or "Lastname, Firstname
Midlelnitials". Which of the following expressions will assign a "newname" variable containing the same name, but with the format "Firstname
Lastname" or "Firstname Middlelnitials Lastname"? e.g., the name "Sacan, Ahmet" should produce the newname "Ahmet Sacan" and the name
"Sacan, Ahmet J." should produce "Ahmet J. Sacan". Assume that the comma character appears only once in the name variable.
There may be more than one correct answer. Select all correct answers.
O newname = strjoin( fliplr(strsplit(name, ',')), '')
O newname = strjoin( fliplr(strip(strsplit(name, ','))), '')
I find(name==',');
newname = [name(1(1)+2:end)'' name(1:1(1)-1)]
O I = strfind(name, ', ');
newname = [name(1(1)+2:end) '' name(1:1(1)-1)]
Transcribed Image Text:Assume that "name" variable contains the full name of a person, with the following format: "Lastname, Firstname" or "Lastname, Firstname Midlelnitials". Which of the following expressions will assign a "newname" variable containing the same name, but with the format "Firstname Lastname" or "Firstname Middlelnitials Lastname"? e.g., the name "Sacan, Ahmet" should produce the newname "Ahmet Sacan" and the name "Sacan, Ahmet J." should produce "Ahmet J. Sacan". Assume that the comma character appears only once in the name variable. There may be more than one correct answer. Select all correct answers. O newname = strjoin( fliplr(strsplit(name, ',')), '') O newname = strjoin( fliplr(strip(strsplit(name, ','))), '') I find(name==','); newname = [name(1(1)+2:end)'' name(1:1(1)-1)] O I = strfind(name, ', '); newname = [name(1(1)+2:end) '' name(1:1(1)-1)]
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning