What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-02 20:21:22
how to use javascript to hide content and show through link
$(document).ready(function() { $('li').click(function () { $('.content:visible').hide(); // hides the visible content before $('.content').eq($(this).index()).show(); // shows the corresponding content }); }); Add solution -
Python 2021-10-29 09:44:09
find the index of a character in a string python
foo = "abcdef" # Using find() foo.find('c') # Output: 2 foo.find('g') # Output: -1 # Using index() # foo.index() is like foo.find(), # But when the substring is not found, it raises an exception. foo.index('h') # ValueError: substring not found Add solution -
C++ 2021-10-01 16:41:07
varint index
template <typename> struct tag { }; template <typename T, typename V> struct variant_index; template <typename T, typename... Ts> struct variant_index<T, std::variant<Ts...>> : std::integral_constant<size_t, std::va... Add solution -
Python 2021-09-26 06:07:03
python get position of character in string
foo = "abcdef" # Using find() foo.find('c') # Output: 2 foo.find('g') # Output: -1 # Using index() # foo.index() is like foo.find(), # But when the substring is not found, it raises an exception. foo.index('h') # ValueError: substring not found Add solution