String Manipulation
-
I Have a string
<Parameters>
<UserProfileState>0</UserProfileState>
<Parameter>
<Name>Report_Parameter_0</Name>
<Type>String</Type>
<Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_0</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser> </Parameter>
<Parameter> <Name>Report_Parameter_1</Name>
<Type>String</Type> <Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_1</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser>
</Parameter> </Parameters>I want to do string manipulation with this and i want to <Name>Report_Parameter_0</Name> they are 2 its not xml ..! how to do in good method.! any help is greatly appreciated..!
-
I Have a string
<Parameters>
<UserProfileState>0</UserProfileState>
<Parameter>
<Name>Report_Parameter_0</Name>
<Type>String</Type>
<Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_0</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser> </Parameter>
<Parameter> <Name>Report_Parameter_1</Name>
<Type>String</Type> <Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_1</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser>
</Parameter> </Parameters>I want to do string manipulation with this and i want to <Name>Report_Parameter_0</Name> they are 2 its not xml ..! how to do in good method.! any help is greatly appreciated..!
-
Ty For Your Reply..! How Can i get the value of
<<Name>Report_Parameter_0</Name>
Report_Parameter_0 for this one..!
-
Ty For Your Reply..! How Can i get the value of
<<Name>Report_Parameter_0</Name>
Report_Parameter_0 for this one..!
I guess if you could get down to <<Name>Report_Parameter_0</Name> using regular expressions or otherwise, you could then just use a strings substring or indexOf property to parse the parameter. Report_parameter_o is actually an xml string, so you could even try using XDocument document = XDocument.Parse(xmlString); via Linq. I have not tried that myself, so please dont screw me if it does not work :) .
-
I guess if you could get down to <<Name>Report_Parameter_0</Name> using regular expressions or otherwise, you could then just use a strings substring or indexOf property to parse the parameter. Report_parameter_o is actually an xml string, so you could even try using XDocument document = XDocument.Parse(xmlString); via Linq. I have not tried that myself, so please dont screw me if it does not work :) .
Abhinav S wrote:
so please dont screw me if it does not
LoL :laugh: Thanks For Your suggestion i will try..!:cool:
-
Ty For Your Reply..! How Can i get the value of
<<Name>Report_Parameter_0</Name>
Report_Parameter_0 for this one..!
Hi 1. The string you posted is a valid XML. So why can't you load the string into an XML Document and navigate through the Child Nodes? 2. Or Use good old plain string matcing. Find the Start Index of <Name> and </name>. Then get the substring. 3. Use Regular Expressions
-
I Have a string
<Parameters>
<UserProfileState>0</UserProfileState>
<Parameter>
<Name>Report_Parameter_0</Name>
<Type>String</Type>
<Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_0</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser> </Parameter>
<Parameter> <Name>Report_Parameter_1</Name>
<Type>String</Type> <Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_1</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser>
</Parameter> </Parameters>I want to do string manipulation with this and i want to <Name>Report_Parameter_0</Name> they are 2 its not xml ..! how to do in good method.! any help is greatly appreciated..!
This is xml file. you can use xml object to find the parameters.......
-
I Have a string
<Parameters>
<UserProfileState>0</UserProfileState>
<Parameter>
<Name>Report_Parameter_0</Name>
<Type>String</Type>
<Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_0</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser> </Parameter>
<Parameter> <Name>Report_Parameter_1</Name>
<Type>String</Type> <Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_1</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser>
</Parameter> </Parameters>I want to do string manipulation with this and i want to <Name>Report_Parameter_0</Name> they are 2 its not xml ..! how to do in good method.! any help is greatly appreciated..!
-
I Have a string
<Parameters>
<UserProfileState>0</UserProfileState>
<Parameter>
<Name>Report_Parameter_0</Name>
<Type>String</Type>
<Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_0</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser> </Parameter>
<Parameter> <Name>Report_Parameter_1</Name>
<Type>String</Type> <Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_1</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser>
</Parameter> </Parameters>I want to do string manipulation with this and i want to <Name>Report_Parameter_0</Name> they are 2 its not xml ..! how to do in good method.! any help is greatly appreciated..!
It sure looks like XML to me. I'd use an XmlDocument or a Regular Expression.
-
I Have a string
<Parameters>
<UserProfileState>0</UserProfileState>
<Parameter>
<Name>Report_Parameter_0</Name>
<Type>String</Type>
<Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_0</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser> </Parameter>
<Parameter> <Name>Report_Parameter_1</Name>
<Type>String</Type> <Nullable>False</Nullable>
<AllowBlank>True</AllowBlank>
<MultiValue>False</MultiValue>
<UsedInQuery>False</UsedInQuery>
<State>MissingValidValue</State>
<Prompt>Report_Parameter_1</Prompt>
<DynamicPrompt>False</DynamicPrompt>
<PromptUser>True</PromptUser>
</Parameter> </Parameters>I want to do string manipulation with this and i want to <Name>Report_Parameter_0</Name> they are 2 its not xml ..! how to do in good method.! any help is greatly appreciated..!