Text 1 =the business-type activities and the aggregate remaining fund information of the Housing Authority of the County of Alaska (the “Authority”), as of and for the year ended June 30, 2023,
output = the business-type activities and the aggregate remaining fund information of the Housing Authority of the County of Alaska (the “Authority”)
Text 2 =the governmental activities and each major fund of the Tribe (the “Tribe”), as of and for the year ended December 31, 2022
Output = the governmental activities and each major fund of the Tribe (the “Tribe”)
From the given text 1 and 2 i need to remove keywords starting from “as of” in the given text, please help me to find the solution
Assign -> Input: "the business-type activities and the aggregate remaining fund information of the Housing Authority of the County of Alaska (the “Authority”), as of and for the year ended June 30, 2023"
Assign -> Output = System.Text.RegularExpressions.Regex.Replace(Input,"as\s*of[\s\S]*?\d{4}","").Trim().Replace(",","")
Assign -> Input: "the governmental activities and each major fund of the Tribe (the “Tribe”), as of and for the year ended December 31, 2022"
Assign -> Output = System.Text.RegularExpressions.Regex.Replace(Input,"as\s*of[\s\S]*?\d{4}","").Trim().Replace(",","")
You can use split function here
Assign Text1,Text2 as string type variable
Assign variable as array of string as Output_Text1 and Output_Text2
Output1 =Text1.split(","c)
Use Output1(0).tostring you will get the output of text1 prior to “as of”
I used text1 randomly but we have same “,” before as of of your text.