Click here to Skip to main content
16,004,587 members

Comments by ludosoep (Top 5 by date)

ludosoep 27-Jun-22 7:57am View    
You can't. VS won't allow it as it is public by definition.
ludosoep 27-Jun-22 3:37am View    
Okay, the answer is actually there though. Did you read the rest of my answer?

ICloneable is an interface declared with a public access modifier.

ICloneable.Clone() is an interface method declared with a public access modifier.

Your class has a method Clone() which returns a Car. This doesn't override the ICloneable.Clone() as there are no parameters and return types cannot be overridden.

So you need to declare object ICloneable.Clone(). This doesn't require any access modifiers to be set as these are inherited from the ICloneable interface.

Hence, ICloneable.Clone() is public by definition.
ludosoep 13-Jun-22 16:15pm View    
Okay, so as Dave already mentioned below, it is not possible, or at least not when using the double type. You can use xs:string, but please keep in mind it is a textual value and not a numeric value.

So the only thing you seem to be missing is the . in your pattern and the single quotes that are obsolete. This simpleType should work:


<xs:simpleType name="tprice">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9\.]*|exist"/>
</xs:restriction>
</xs:simpleType>


The \. is to match the dot and the slash is to escape the dot, as this means "match all" in regex.

HTH. Cheers
ludosoep 13-Jun-22 5:11am View    
Okay, then the code previously posted should be enough. Only thing I forgot is to add lowercase to matching the keywords. So instead of var keyword = word.Trim('.', ',', '!', '?'); it should be var keyword = word.Trim('.', ',', '!', '?').ToLower();. Of course you can add more punctuations if necessary. Hope to hear if it works! Cheers
ludosoep 10-Jun-22 15:07pm View    
+1