'Event AnyMethodCalled vb.net

I need to run this code after every method is executed:

Debug.WriteLine(System.Reflection.MethodInfo.GetCurrentMethod())

A nice solution would be an event 'AnyMethodCalled' which would be fired after any method is fired. Is there anything like this? Or do I have to add this line to every Sub in my class?



Solution 1:[1]

Very simple with Set: (just cast it back to an array)

console.log([...new Set("English-Language")]);
console.log([...new Set("Javascript String")]);

And if you want it as a single string, do this:

console.log([...new Set("English-Language")].join(","));
console.log([...new Set("Javascript String")].join(","));

Solution 2:[2]

You can use the split function and the Set class to achieve this like so.

new Set("Javascript String".split(''))

The split('') part splits the string using an empty string as the seperator, so it just returns an array of all the characters. If you make a set from that array, it'll remove the duplicates. You can even pass the string directly to the Set constructor. If you want it as an array, just use Array.from.

Solution 3:[3]

you can simply use str.split("");

const str = 'English-Language';
str.split("");

Let me know if you face any future issue.

or Second option is

console.log([...new Set("English-Language")]);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Samathingamajig
Solution 2
Solution 3