Tag string

[Solved] C# get position of a character from string

string aS = “ABCDEFGHI”; char ch=”C”; int idx = aS.IndexOf(ch); MessageBox.Show(string.Format(“{0} is in position {1} and between {2} and {3}”, ch.ToString(), idx + 1, aS[idx – 1], aS[idx + 1])); This wont handle if your character is at position zero…

[Solved] Why my strings are not going to be XOR?

Just another try on the code base of the question , #include<iostream> #include<string.h> using namespace std; int main() { string pass; string enc=”akdhigfohre”; string x = “”; string y = “”; cout<<“Enter new password: “; cin>>pass; cout<<“\n\nYour New Password is:”…

[Solved] how to parse this string in Python? [duplicate]

You can use regular expressions from re module: import re s = “(‘-1259656819525938837′, 598679497)\t0.036787946” re.findall(r'[-+]?[0-9]*\.?[0-9]+’, s) % gives: [‘-1259656819525938837’, ‘598679497’, ‘0.036787946’] solved how to parse this string in Python? [duplicate]

[Solved] find numbers at string line c++

As mentioned in @Jhonny Mopp’s comment the primary problem is, that you don’t read a whole line here: cin>>line; it just reads up to the next whitespace delimiter. What you actually want is: getline(cin, line); This would read in the…