473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

comparing part of a string regardless the other part

56
how can i compare part of a string with another string regardless the rest of the string?
for example: if i want to find whether a string has an underscore or not
Expand|Select|Wrap|Line Numbers
  1. if(x[i].equals("anything_anything"))
i want this if condition to return true
how can i do that ?
Apr 20 '14 #1
1 1588
Norgy
56
i found a function called "contains" that do what i need
Expand|Select|Wrap|Line Numbers
  1. if(x[i].contains("_"))
thanks :)
Apr 20 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Picture Dots | last post by:
Ok - I want to check a string for @ in it (Im checking to see if a string that should contain an email holds a @ ) How would I go about this? preg_match? ereg? strstr?Examples? Also - how...
1
by: José Carlos | last post by:
Hi. How can i part a big string to block of information of (4Kb for example).? i´m trying send it from a socket client to server and how can i calculate the time it´s coming. Thank you. ...
1
by: Peter Scheurer | last post by:
I have a statement that works in compatibility mode 8 of SQL Server 2000 while it fails in 7: declare @P3 int exec sp_prepexec @P3 output, N'@P1 float', N'select custname from customer where...
13
by: sakitah | last post by:
Hello Everyone, Here's the problem (I'm using Visual c++ 6.0): I have a string: string1 = "This&is&life";
3
by: ronenk | last post by:
I have a good authentication form, which I use to login to my app. Now I want to be able to know which user is logged in now, in order to fill his answers in DB. In other words: I need to save &...
13
by: Hongyu | last post by:
Hi, I have a datetime char string returned from ctime_r, and it is in the format like ""Wed Jun 30 21:49:08 1993\n\0", which has 26 chars including the last terminate char '\0', and i would...
0
by: frkem | last post by:
After virus infection (Sohanad 32) an I deleted all infected files my windows operating system is not working. Windows media player, search, help and support icon by double clicking it one message...
2
by: shockna1 | last post by:
Im trying to compare a string variable to a tab if (someStringVar == "\t") ... but that doesnt seem to work.
0
by: varun789 | last post by:
I had this issue of comparing two strings having two single quotes each. It was like comparing string "''" with "''". This is how I did it: SELECT * FROM TABLE_NAME WHERE...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.