Kth space | C # program of the above approach ; Function to extract integer at key position in the given String ; StringTokenizer ( ) : Extracts the number at key c_str ( ) : Type cast String to char * ; Driver Code ; Given String ; Given K ; Function call
using System ; class GFG { static void print_kth_String ( String str , int K ) { String [ ] iss = str . Split ( ' ▁ ' ) ; K -- ; Console . Write ( iss [ K ] ) ; } public static void Main ( String [ ] args ) { String s = ( "10 ▁ 20 ▁ 30 ▁ 40" ) ; int K = 2 ; print_kth_String ( s , K ) ; } }